I very briefly mentioned this in an article about two years ago that you might also be interested in (There is No Difference Between Fur and Hair), but I’ll go into more detail here. Hair length is completely controlled by the length of the anagen phase of your hair follicle. How long this period lasts is generally determined mostly by genetics, but can also be affected by hormones, and even extreme stress. More specifically, there is a chemical signal that ultimately controls the exact growth cycle.
Following the anagen phase is the catagen phase. It isn’t yet known what triggers the catagen phase, but once it is triggered, the outer part of the root ends up being cut off from its nutrient supply (blood), as well as the cells that produce new hair, thus your hair stops growing. This phase lasts about three weeks.
Next up comes the telogen phase where the follicle is in a resting state and your hair is now a “club hair”, completely dead down to the root. During this stage, these hairs are relatively easy to pull out (as can happen while brushing/combing/washing your hair), but if they manage to last long enough, they’ll eventually be pushed out by a new hair as the cycle begins again.
Obviously hairs on your arms or legs have a very different anagen period than hairs on your head, thus why your leg hair doesn’t grow two feet long without trimming. Further, different people, thanks mostly to their genetics, have differing lengths of the anagen period for a given body part compared to other people. For the hair on your head, the average length of the anagen phase is about 2-7 years. For your arms, legs, eyebrows, etc., this phase usually lasts just 30-45 days. However, in extreme cases which are quite rare, some people have anagen periods for their heads as small as most people’s anagen phases for their arms and legs. For these people, their hair never naturally grows more than a few inches long, presumably saving them a significant amount of money over their lifetime on barber visits. ;-) The opposite is also true, with people whose anagen phase can last decades for their scalp hair. Both of these extremes are very rare though.
At any given time about 85%-90% of your hair is in the anagen phase, 1-2% is in the catagen phase, and 10-14% is in the telogen phase. However, extreme stress can trigger the anagen phase to stop prematurely and hair can rapidly progress to the telogen phase, even as much as 70% of the hair on your body. When this happens, the majority of your hair that should still be growing can fall out all at once.
Under normal circumstances, though, you can get a rough estimate of how long your anagen phase is based on how long your hair grows naturally without cutting on a given area. First, assuming your hair isn’t already as long as it can get, measure your hair length, then exactly a month later measure it again and note the difference. Now you have your growth rate (usually about 1 cm every 28 days or 1 inch every 71 days). So if, without cutting, the hair on your head eventually grows 16 inches long max, then your anagen phase lasts: (inches*period per inch). So using the average of 1 inch every 71 days, (16 inches * 71 days/inch) = approximately 1136 days or 3.11 years.
Now to specifically answer the second part of your question “…but then when you cut it, it will grow back to its maximum length”, this is just because when the cycle restarts, new hair comes in that can grow to the maximum length, eventually replacing the old hair that will be shorter than it could have been because you cut it.
As you might have now guessed from the fact that hair growth is completely controlled by what’s going on under the surface, within your hair follicles, and that genetics and hormones are the primary things determining hair growth length, which are in no way affected by shaving, shaving does not in any way alter your hair growth rate nor does it alter the color of the hair. You can read more about this here: Shaving Does Not Make Your Hair Grow Back Thicker or Faster
Another hair fact article you might be interested in, which happens to be one of my favorite articles on this site, is this one: What Causes Red Hair
Expand for References