Depends on the child and the type of diet. If you mean weight loss diet without any other restrictions, then maybe 18. But if a kid is 100 pounds overweight or double their healthy weight, their doctor may put them on a gradual weight loss diet at a younger age.
Children and teens who have diabetes or high blood pressure or some other diagnosis that requires a nutrient restriction may go on a “diet” at any age i.e. diabetic nutrition therapy, low salt nutrition therapy, etc.
Weight loss is not recommended for children because they are still growing. Restricting calories may inhibit growing as tall as they genetically should or limiting specific nutrients like fat may impair brain development. Talk to your doctor to see what he/she recommends for you.