For USAG, it's by age on the first day of states or age on the date of meet - w/ usually a relatively equal amount of gymnasts in each awards group. The higher the level, the older the "and under" and the "and up" age groups become, and often very popular ages for that level will be in an A and B based on a midpoint DOB.
For instance, for L4 it's usually 7 and under, 8, 9, and 10 and up. For L5 I usually see 8 and under, 9A, 9B, 10, 11 and 12 and up. For L6 I saw a lot of 9 and under, 10A, 10B, 11 and 12 and up, etc. It seems like once it's Optionals, there are usually 2-3 junior groups, and 2-3 senior groups, and I think the juniors are younger than 12 and the seniors 12 and up. Of course, that number may go up w/ the levels (like maybe for level 8 it's 13, 9 it's 14, etc.)...