There's really no age that a kid or child is too old to wear diapers since diapers can be worn by any age of child or even teens and adults if they need to wear them for incontinence or other development issues.
But as for potty training if the child is mentally able to potty train and has good bladder muscles then the child should be potty trained before age 4 because that's when most children enter preschool.
A child has to be potty trained before going to kindergarten at age 5 or 5 and half years of age so the child must be potty trained and out of diapers during the daytime by kindergarten age.
Nighttime is a different story and some kids will need to wear diapers or Pull Ups well into their teen years for bed wetting which is okay and normal.