It is better for women to pray in their houses than to attend congregational prayers. However, they may go to the mosque and attend the congregational prayer if they avoid wearing or using any attractive or tempting adornment or perfume.
Ibn ‘Umar reports that the Prophet sallallahu alehi wasallam said: “Do not prevent the women from going to the mosques, although their houses are better for them.” Abu Hurairah relates that the Prophet said: “Do not keep the slave girls of Allah from the mosques of Allah. And they are to go out unperfumed.” These two ahadith were related by Ahmad and Abu Dawud. Abu Hurairah also reports that the Prophet said: “Any woman who uses some scent should not be present with us during the night prayer.” This is related by Muslim, Abu Dawud, and an-Nasa’i with a hasan chain.
As stated earlier, it is better for women to pray in their houses. Ahmad and at-Tabarani record that Umm Humaid as-Sa’diyah came to the Messenger of Allah and said: “O Messenger of Allah, I love to pray with you.” The Prophet said: “I am aware of that, but your salah in your residence is better for you than your salah in your people’s mosque. And your salah in your people’s mosque is better than your salah in the [larger] congregational Mosque.”