There are many reasons to have heavy periods. Sometimes, they are just related to fluctuations in hormone levels, provoked for example by stress, disturbance in your sleep-wake cycle, or other environmental factors.
Sometimes, heavy periods are caused by a medical problem. The most common is probably thyroid imbalances, which commonly cause irregular or heavy periods. There are also some gynecologic conditions, such as endometriosis
or uterine fibroids, which may be associated with heavy periods.
And, just as you say, an ectopic pregnancy may cause a heavy period. An ectopic pregnancy is a pregnancy which implants in the abdomen outside of the uterus. Usually these pregnancies miscarry early, which could cause heavy bleeding. Ectopic pregnancies can be dangerous, and if you have any abdominal pain at all you need to get that checked out as soon as possible.
Alternatively, a miscarriage of a normally implanted pregnancy (in the uterus) will also cause heavy bleeding.
If the bleeding continues or if you have any other concerning symptoms, such as fever
or abdominal pain, you should seek emergency medical attention. Otherwise, you should discuss the issue when you are able with either your primary care doctor
or your OB GYN doctor who will be able to answer your questions.