It is going to depend on the gym and the program.
There are no age limits, you can take up gymnastics in your 40's and start competing, and just like at any age how well you do would have more to do with your own natural talent and effort than your age.
But many gyms have an age limit on their programs for a variety of reasons. Many, many gyms would not take a beginner level 12 year old onto their team, especially in JO. But many gyms will allow an older gymnast to co,Pete in their excel team.
Alternatively to gymnastics there are other competitive gymsports where kids often start competing older such as sports acrobatics, trampoline, sports aerobics, team gym and cheerleading.