Messenger of Allah (S) said: "Teach the boy Salat when he is seven years old, and beat him (if he does not pray) when he is ten." (Using translation from Tirmidhī 407)
قَالَ رَسُولُ اللَّهِ ﷺ «عَلِّمُوا الصَّبِيَّ الصَّلَاةَ ابْنَ سَبْعِ سِنِينَ وَاضْرِبُوهُ عَلَيْهَا ابْنَ عَشْرٍ»