Yoma8: 4
הַתִּינוֹקוֹת, אֵין מְעַנִּין אוֹתָן בְּיוֹם הַכִּפּוּרִים, אֲבָל מְחַנְּכִין אוֹתָם לִפְנֵי שָׁנָה וְלִפְנֵי שְׁנָתַיִם, בִּשְׁבִיל שֶׁיִּהְיוּ רְגִילִין בְּמִצְוֹת.
We do not afflict the children on Yom Kippur, but we train them prior to the [previous] year or prior to two years, so that they should be accustomed to commandments.