The Shulchan Arukh (Orach Chaim 308:45) forbids playing ball on Shabbos or Yom Tov (even in a place where there is an eruv). The Rema (ad loc.) writes that the custom is to be lenient. However, later authorities overwhelmingly disagree with, or limit, the Rema's leniency.
The Magen Avraham (518:4) and Taz (518:2) rule that the leniency only applies to children under the age of bar mitzvah. The Mishnah Berurah (518:9) is similarly strict. Shemiras Shabbos Ke-Hilkhasah (16:1,6) also forbids it to anyone above bar mitzvah.
R. Yosef Chaim Sonnenfeld (Salmas Chaim 1:71) rules like the Shulchan Arukh, and therefore forbids even children to play ball. R. Chaim Na'eh (Badei Ha-Shulchan 110:16) rules that the Rema's leniency only applies to an ad hoc game and not anything scheduled in advance.
However, the Shulchan Arukh Ha-Rav (308:83) writes that the practice has been to be lenient and no one protested because those who are lenient have on what to rely. The Arukh Ha-Shulchan (308:70, 518:8) is entirely lenient, permiting playing ball on Shabbos and Yom Tov.
R. Pinchas Bodner (The Halachos of Muktzeh, p. 22 n. 16, p. 25) rules like the Shulchan Arukh Ha-Rav but adds that it is "not proper" but "cannot be prohibited (since technically no Shabbos prohibitions are violated)."
In concluding his discussion of this subject, R. J. Simcha Cohen writes (Shabbat The Right Way: Resolving Halachic Dilemmas, p. 124) writes:
Organized ball games (or other athletic activities) that involve anyone over the age of bar/bat mitzvah appear to be in violation of uvda de-chol. They contravene the mitzvot of mikra'ei kodesh and ba-yom ha-shevi'i tishbot. Thus, they should be strongly discouraged...Of course, everyone should ask their own rabbi.
Between the ages of five (commonly assumed to be the lowest age for chinuch) and bar/bat mitzvah, the propriety of ball-playing may be a matter of dispute due to a difference of opinion regarding the age of chinuch. Therefore its appropriateness will depend upon the evaluation of the rabbi of the individual children involved and the community's requirements.