Well, the answer to that question varies depending on your hair and your objectives. But, there are useful guidelines.
First, if you want to just maintain your current length, to avoid split ends and breakage, you should not go any longer than 6-8 weeks between haircuts. However, long hair, which is older, and chemically treated hair is more fragile than short hair, so it is best to cut your hair at least every 6 weeks. Every 4-6 weeks might be even better, depending on how fast your hair grows.
For shorter hair, if you just want to maintain your length, 4-6 weeks is a good guideline (growth on shorter hair is, of course, more noticeable than on longer hair).
On average, hair grows about 1/2 inch per month. But, person to person, that can vary significantly. So, the timing gets a bit more complicated if you are trying to grow your hair longer. Then, you are faced with a balance of allowing your hair to grow longer vs. preventing split ends and breaking. If you go too long between haircuts, you will gain added length, but you may actually lose ground when you need to trim your hair more than desired to address split ends or breakage. If you cut more frequently, you will better avoid split ends and breakage, but you may not gain much ground in length.
One approach is to actually measure the length of your hair every week for a couple of months in order to get a more accurate idea of how quickly your hair grows. Then, based on that, with your stylist, determine how much hair needs to be cut each time to maintain its health. From there you can estimate the optimum time between haircuts.
For example, let’s say that you measure you hair for a couple of months and determine that it grows about 1/8 of an inch per week. And, let’s assume you and your stylist estimate that about 1/4 inch should be cut each time to avoid split ends and breakage. Thus, in about 6 weeks your hair will grow about 6/8, or 3/4 of an inch. If you cut your hair about 1/4 of an inch each time, then every 6 weeks you will gain about 2/4, or 1/2 inch. That can then be your recipe for lengthening your hair. If you cut more frequently, it will take a bit longer to reach your desired length. But, again, be careful if choosing to cut less frequently. Doing so could result in damage to the ends of your hair causing a need to cut more than your estimated 1/4 inch at haircut time, and therefore slowing the lengthening process anyway.