During puberty, certain hormones from the brain that stimulate the ovaries are released. The ovaries then produce estrogen and progesterone, hormones that make the eggs in the ovaries mature so the woman can have a child. If the egg reaches the uterus and is fertilized by sperm, it attaches to this cushiony wall, using the extra blood and tissue to nourish itself as it slowly develops into a baby. Most of the time the egg just passes right through without fertilization. Since the uterus no longer needs the extra blood and tissue which made the walls thick, it sheds them through the vagina.
Periods are different for every woman.
Some girls start menstruation when they're 9 or 10, some in their late teens. The length of the cycle also varies. Some girls periods last longer than 28 days, some shorter. If you have just begun your menstruation, your body will need time to regulate itself to these changes. So your periods might be a bit erratic at first.