Praise be to Allah.
Yes, a number of saheeh ahaadeeth (Prophetic narrations) were narrated concerning this etiquette. For example, it is narrated from Jaabir ibn ‘Abd-Allaah (may Allaah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said:
“When the wings of the night spread – or when evening comes – keep your children in, for the devils come out at that time. Then when part of the night has passed, let them go. And close the doors and mention the name of Allaah, for the shaytaan (devil) does not open a closed door. And tie up your waterskins and mention the name of Allaah, and cover your vessels and mention the name of Allaah, even if you only put something over them, and extinguish your lamps.”
Narrated by al-Bukhaari (3280) and Muslim (2012).
Al-Nawawi included this in a chapter entitled Chapter on covering vessels, tying up waterskins, locking doors, mentioning the name of Allaah over them, extinguishing fires and lamps when going to sleep, and keeping children and livestock in after Maghrib.
Muslim (2013) also narrated from Jaabir (may Allaah be pleased with him) that he said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Do not let your animals and children go out when the sun has set, until the first part of the night is over, for the devils come out when the sun sets, until the first part of the night is over.”
Al-Haafiz ibn Hajar (may Allaah have mercy on him) said concerning the first hadeeth:
“The wings of the night” refers to when night comes after the sun has set.
The words “then let them go” – Ibn al-Jawzi said: Rather there is fear for children at that hour, because the najaasah (impurity)that the shayaateen (devils) seek is usually present with them at that time, and the dhikr (remembrance of Allah) that would protect them is usually absent from children, and when the shayaateen spread out they hang on to whatever they can hang on to. Hence there is fear for children at that time.
The reason why they spread out at that time is that they are more able to move about at night than during the day, because darkness is more conducive to devil forces coming together than any other time. End quote.
Fath al-Baari, 6/341
al-Nawawi (may Allaah have mercy on him) said:
This hadeeth includes a number of types of goodness and etiquette which combine the interests of both this world and the Hereafter. The Prophet (peace and blessings of Allaah be upon him) enjoined these etiquettes which are the cause of safety from the harm of the shaytaan (devil) , and Allaah has made all of these means causes of being safe from his harm. He is not able to uncover vessels or untie waterskins or open doors or harm children or others if these means are followed. This is like what it says in the saheeh hadeeth, (authentic narration) that if a person says Bismillah when entering his house, the shaytaan (devil) says “No place to stay” i.e., we have no authority to stay overnight with these people. And if a man says when having intercourse with his wife, “O Allaah, keep the shaytaan away from us and keep the shaytaan away from what You bestow upon us (of offspring),” that will be a cause of the child being kept safe from the harm of the shaytaan. This is similar to this hadeeth, which is well known among saheeh ahaadeeth.
This hadeeth encourages us to remember Allaah in these cases and other similar situations. Our companions said: It is mustahabb (preferred) to mention the name of Allaah over everything that matters, and to praise Allaah at the beginning of everything that matters, because of the well known hasan hadeeth (sound narrations).
The words “wings of the night” is a well known phrase that refers to the darkness of the night. And it was said that it refers to when the darkness of night comes.
The words of the Prophet (peace and blessings of Allaah be upon him) “Keep your children in” mean: prevent them from going out at that time.
The words “for the devils come out at that time” mean that there is the fear at this time that children may be subjected to the devils’ harm because there are so many of them at that time. And Allaah knows best. End quote.
Sharh Muslim (13/185).
The Standing Committee for Issuing Fatwas was asked the following question:
In the saheeh hadeeth narrated by al-Bukhaari, it says: “When the wings of the night spread, or when evening comes, keep your children in.” Then it says: “And extinguish your lamps.” Does this command mean that it is obligatory? If it is mustahabb, what is the evidence to show that it is not obligatory?
They replied: The commands mentioned in this hadeeth are to be understood as recommendations and advice, according to most scholars, as was stated by a number of scholars, such as Ibn Muflih in al-Furoo’ (1/132), al-Haafiz Ibn Hajar in Fath al-Baari (11/97). And Allaah knows best. End quote.
Fataawa al-Lajnah al-Daa’imah (26/317)
And Allaah knows best.