Since this is the most common question from high school and college girls, here are some questions to help sort it out.
#1 Are you in calorie excess or deficit?
Are you eating too much or too little for your baseline metabolism, plus whatever activities you do? For many girls, the brain will inhibit a cycle if resources are low. And also if calories or carbs are too high, it can cause irregular cycles for different reasons. So this is the place to explore by tracking food and activity for a few days.
If you're walking around hungry all or much of the time, if you're eating low carb or keto or have food intolerances that restrict your options, if you're a picky eater, if you're busy, stressed, or sad and not interested in food... you may be under-eating.
If you tend to crave carbs and eat more when stressed, if you love to bake or eat but don't love to exercise, if you eat half the plate of homemade cookies while they're warm, if you don't sleep much or well at night... you many be over eating or "over-carbing" relative to what your metabolism can handle. Short sleep changes carb tolerance. A website like Cronometer.com can help you see how much nutrition you're getting in a day relative to exercise and nutrient needs for your age.
#2 What is your body type?
This gives insight into your type of metabolism and whether there may be an excess or deficit of calories. When someone who is 5'4" and 100 pounds has irregular cycles, it's more likely there's a deficit, If a woman is 5'4" and 160 pounds, it's more likely there is an excess. BUT this does not take into account bone structure and muscle mass.
Sometimes a person who is 5'4" actually has a very fine bone structure and small muscles and would ideally be 105-110 pounds; that extra 10+ pounds on a small frame can be enough to cause hormone imbalance and irregular cycles. Sometimes the person who is 5'4" and 160 is extremely well-muscled and their metabolism is working fine, or they could have an extra 10-15 extra pounds. It's possible to look "just right" and be under-fat for what your brain considers enough resources for a cycle. Some women will lose their cycle if they get lean enough to see abs, while others can be quite lean and maintain a regular cycle.
So weight and height are part of the picture, and also how weight is distributed. Do you have a small, defined waistline or do you tend to gain weight in your torso and lose your waist? Can you see your wrist, ankle and elbow bones easily? What cut of jeans do you buy - straight or curvy?
# 3 Do you need more iron?
This is about low iron throughout the body, which is different from anemia as measured in the blood. It's easy for teen girls not to get enough iron if they don't care for meat, eggs, beans and vegetables. If there's a lot of dairy in your diet it can easily crowd out iron-rich foods.
Many women have shared with me that they had long cycles and/or long bleeding each month until they supplemented iron. They were not anemic according to hemoglobin levels, or they were borderline, but this is a late indicator of low iron. If you're not able to test ferritin, which reflects overall iron in the body, try a supplement like Blood Builder or Dessicated Liver for a couple of months and see what changes.
# 4 Do travel, coffee, late nights, and other physical stressors cause the variations?
It seems that some women's bodies prioritize their cycles, and others don't. There are women who have clockwork cycles in refugee camps, and women who will ovulate a week later if they change time zones or stay up too late one weekend. Track what events might be disrupting your cycle and note the level of sensitivity to various factors. Once you know, you can anticipate it to some degree, and perhaps mitigate the effect of those stressors.
# 5 Are your room mates or house mates shifting your cycle?
Many college girls have share that their period comes early or late when they return to school after the summer. Sharing clothes, even without sharing a room, may increase the dorm effect. So you could reduce your "exposure" or just expect it to shift each time you return to school after a break, and carry what you'll need if it comes unexpectedly.
There are more details that can be considered, but this is where to start. Hope this helps!