عن جابر رضي الله عنه قال: قال رسول الله صلى الله عليه وسلم : «لا يَبِيتَنَّ رجل عند امرأة ثيِّب، إلا أنْ يكون ناكِحًا أو ذا مَحْرَم».
The Prophet (may Allah's peace and blessings be upon him) forbids staying the night at the place of a woman whom one is not married to, especially that of a woman who has been previously married, for she is often accessible. Virgins, however, avoid men. If men are forbidden access to non-virgins, who are usually accessible, then they are even more so forbidden access to virgins.
The exception here applies to one's wife and one's blood relatives, such as his mother; daughter; sister; relatives through fostering, such the suckling mother; and relatives through marriage, such as one's mother-in-law. "Staying the night" does not mean that a man is allowed to stay in seclusion with a non-Mahram woman during the daytime. According to Sahīh Al-Bukhāri, the interdiction is general and not restricted to the night time.
If a Mahram, however, is not trustworthy, a non-Mahram woman must be accompanied by other women.
Download for free and never miss a prayer again