All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Scholars differed regarding the age when the period of youth ends. It was said that it ends at thirty or thirty-two. Ash-Shawkaani, said: “The linguistic origin of it (the Arabic term Shabaab, meaning youth) denotes movement and activity. It is a noun used in reference to those who have reached puberty until they reach the age of thirty; this is the opinion of the Shaafi‘is, and it was reported by the author of Al-Fat-h. Al-Qurtubi said in Al-Mufhim:
'A person is described as Hadath (child) until the age of sixteen, then Shaabb (youth/young person) until the age of thirty-two, and then Kahl (mature person).' Az-Zamakhshari said: 'Youth starts from reaching puberty until the age of thirty-two.' The Maaliki scholar Ibn Shaas said in his book Al-Jawaahir: '… until the age of forty.' An-Nawawi said that the sound chosen opinion is that a Shaabb is the one who reached puberty and is not past the age of thirty. Afterward, he is Kahl until he passes the age of forty; afterward, he is Shaykh (elderly).'" [End of Quote]
There are reported texts indicating the virtue of worshiping Allah, The Exalted, at a young age, like the Hadeeth about the seven persons whom Allah will shade in the Shade of His Throne, and among them will be a youth who grew up worshipping Allah. Moreover, it was narrated by Imaam Ahmad in Al-Musnad, on the authority of ‘Uqbah ibn ‘Aamir that the Prophet, sallallaahu ‘alayhi wa sallam, said: "Allah, The Exalted, wonders (practices) 'Ajab (which entails that He is greatly pleased with) a youth who has no inclination (to worldly pleasures)." Whoever is at that age and devotes himself to the worship of Allah, The Exalted, and obeying Him, is hoped to earn this great reward. A person in his twenties is still at the age of youth, and he shall earn the reward of worshipping Allah, during youth if he strives in worship. Whoever is past the age of youth and reached thirty or forty or more, still has the chance to catch up. Actually, whoever strives to obey Allah, The Exalted, diligently at any age, keenly seeks to earn His pleasure, and repents to Him sincerely, then, Allah will compensate and reward him for his obedience because Allah, The Exalted, does not allow the reward of those who do good to be lost. However, the rewards earned by young persons are more perfect because of their physical strength and inner inclination to follow lusts, and given the reported texts that prove the virtue of obeying Allah, The Exalted, in that state.
For more benefit on the age at which the phase of youth ends, please refer to Fatwa 242842.
Allah Knows best.