I have periods two sometimes three weeks out of a month what causes this?

Treatment options . The cause of the heavy periods is not something we can always answer. There are lots of treatment options you can discuss with your doctor. Lysteda is a nonhormone medication designed for heavy periods. Some benefit from birth control pills, patch or nuvaring. Mirena (levonorgestrel) iud can stop your period in some cases. Consider an endometrial ablation if you are done having children.
Poor ovulation or... Depends on cause of heavy bleeding. Need evaluation (labs) and sonogram. Often due to poor ovulation (polycystic ovaries - pcos). So no order to female hormones and hence no order to uterine bleeding. Non-surgical options include: birth control pills, cyclic progestin, Lysteda (non-hormonal rx taken during period), & Mirena (levonorgestrel) iud.