Usually children move about freely in their parent’s house. However, there are limitations for older children, who at certain times should ask their parent’s permission before entering their bedroom. Allah (SWT) says,
"O you who believe! Let your legal slaves and slave-girls, and those among you who have not come to the age of puberty ask your permission (before they come to your presence) on three occasions; before morning prayer, and while you put off your clothes for the noonday (rest), and after the Isha (late-night) prayer. (These) three times are of privacy for you, other than these times there is no sin on you or on them to move about, - attending (helping) you each other. Thus Allah makes clear the Ayat (the Verses of this Quran, showing proofs for the legal aspects of persmission for visits, etc.) to you. And Allah is All-Knowing, All-Wise." (An-Nur 24:58)
It is then preferable that when the child is old enough to discern between right and wrong, and easily understands and follows directions (usually from seven years), that he should ask permission before entering. This is especially emphasized at the times when the parents are usually undressed, i.e., from the time after Isha prayer to the Fajr prayer, and during afternoon nap. There is no doubt that this teaches the children to be descent, and protects them from unintentionally attending scenes that may be shocking to them. When the child reaches puberty, he should be taught to ask permission before entering at all times, as Allah (SWT) says,
"And when the children among you come to puberty, then let them (also) ask for permission, as those senior to them (in age). Thus Allah makes clear His Ayat (Commandments and legal obligations) for you. And Allah is Al-Knowing, All-Wise." (An-Nur 24:59)
That is how gradually, decency and modesty are integrated in the child’s character.
Information from Al-Jumuah Magazine Issue 5, Sha’baan 1416, Page 7
ARTICLE FROM :http://www.muslimdiary.com/articles.php?article_id=379