And when the children among you reach puberty, let them ask permission [at all times] as those before them have done. Thus does Allāh make clear to you His verses; and Allāh is Knowing and Wise.
The Times when Servants and Young Children should seek Permission to enter
These Ayat include a discussion of how people who are closely related should seek permission to enter upon one another. What was mentioned earlier in the Surah had to do with how unrelated people should seek permission to enter upon one another. Allah commanded the believers to ensure that their servants and their children who have not yet reached puberty should seek permission at three times: the first is before the Fajr prayer, because people are asleep in their beds at that time.
وَحِينَ تَضَعُونَ ثِيَـبَكُمْ مِّنَ الظَّهِيرَةِ
(and while you put off your clothes during the afternoon,) means, at the time of rest, because a man may be in a state of undress with his wife at that time.
It has been described in the beginning of this Surah that the injunctions of Surah Nur mostly relate to prevention of obscenity and vulgarity. Under the same sequence some injunctions regarding social etiquette and mutual meetings are also enjoined. After that the injunctions about Hijab for women are prescribed.
The injunction for relatives and mahrams for seeking permission at specific timings
Earlier in this Surah the social etiquette and manners for mutual meetings were described in verses 27, 28 and 29 under the heading 'injunctions on seeking permission', where it was enjoined that if you go to visit someone, do not enter the house without taking permission. Irrespective of the situation whether it is a female section of the house or the male section, and whether the visitor is a man or a woman, it has been made obligatory on every one to seek permission before entering the house. However, these injunctions relate to those who come in the house as visitors. But in the present verses a different type of isti'dhan is enjoined. Here those persons are instructed to seek permission who live together in the same house and keep roaming in the rooms freely. In this category those men are also included with whom the hijab of women is not required (the mahrams). They, too, are advised to make some sort of sound, either by cleaning the throat or by thumping of steps, in order to make their presence felt. This type of isti'dhan is preferable and not obligatory, but to give it up is Makruh Tanzihi. Tafsir Mazhari has remarked:
The blessings of God refer to the position of dominance in the present world and Paradise in the Hereafter. Those who want to make themselves worthy of this blessing should foster three virtues in themselves: piety, charity and the willingness to follow the example of the Prophet. The first quality is evinced in the regular saying of prayers. Observance of prayers regularly acts as a strong incentive to lead a life of sincerity, modesty and humility, rather than one of false pride and arrogance. The second quality takes its practical form in zakat, the prescribed alms-giving, which means the setting aside of some amount at the prescribed rate from one’s wealth and handing it over to bayt al-mal or the ‘Public Fund’. Zakat, conveys the message that people should not be selfish but should be the well-wishers of others. Their well-wishing should go to the extent of fostering a feeling that others have a certain right over them. The third quality is obedience to the Prophet Muhammad. During his lifetime, this meant obeying him personally, while beyond his lifetime, it means obeying his sunnah or tradition. In other words, in all matters of life, the ideal example for the people should be the life of the Prophet of God. People should accept only him as their guide and when confronted with his pronouncements, they should forego their personal opinions. The Prophet should be in the lead and all others should be behind him.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.