A hormonal imbalance is one reason, endometriosis is another condition that can cause bad cramping, heavy flow, and long periods.
Your period last usually 4-6 days. It takes that long because your body has to get out all of the blood and padding that provides support for the egg in the uterus. Once the egg is not feralized, there is no need for the padding, so it goes away. Its only way out is your vagina.
* If you period last longer than 6 days, you may want to consult a doctor.