Praise be to Allah.
There is no doubt that a woman’s prayer in her house is better for her than praying in the mosque, as is indicated by the Sunnah of the Prophet (Peace & Blessings of Allaah be upon Him). He said: "Do not prevent your women from going to the mosque, even though their houses are better for them." (Reported by Abu Dawud in al-Sunan, Baab maa jaa’a fee khurooj al-nisaa’ ilaa’l-masjid: Baab al-tashdeed fee dhaalik. See also Saheeh al-Jaami‘, no. 7458).
Whenever a woman prays in a place that is more private and more hidden, that is better for her, as the Prophet (Peace & Blessings of Allaah be upon Him) said: "A woman’s prayer in her house is better than her prayer in her courtyard, and her prayer in her bedroom is better than her prayer in her house." (Reported by Abu Dawud in al-Sunan, Baab maa jaa’a fee khurooj al-nisaa’ ilaa’l-masjid. See also Saheeh al-Jaami‘, no. 3833).
Umm Humayd, the wife of Abu Humayd al-Saa‘idi reported that she came to the Prophet (Peace & Blessings of Allaah be upon Him) and said: "O Messenger of Allaah, I love to pray with you." He said: "I know that you love to pray with me, but praying in your house is better for you than praying in your courtyard, and praying in your courtyard is better for you than praying in the mosque of your people, and praying in the mosque of your people is better for you than praying in my mosque." So she ordered that a prayer-place be built for her in the furthest and darkest part of her house, and she always prayed there until she met Allaah (i.e., until she died). (Reported by Imaam Ahmad; the men of its isnaad are thiqaat (trustworthy)).
But the fact that praying at home is preferable does not mean that that women are not permitted to go to the mosque, as is clear from the following hadeeth:
From ‘Abdullah ibn ‘Umar, who said: "I heard the Messenger of Allaah SAWS (peace be upon him) say: ‘Do not prevent your women from going to the mosque if they ask your permission.’" Bilaal ibn ‘Abdullah said, "By Allaah, we will prevent them." (Ibn ‘Umar) turned to him and told him off in an unprecedented fashion, saying: "I tell you what the Messenger of Allaah (Peace & Blessings of Allaah be upon Him) said, and you say ‘By Allaah, we will prevent them’!!" (reported by Muslim, 667).
But there are conditions attached to the permission for women to go to the mosque, as follows:
(1) She should wear complete hijaab.
(2) She should not go out wearing perfume.
(3) She should have the permission of her husband.
Her going out should not involve any other kind of prohibited acts, such as being alone in a car with a non-mahram driver. If a woman does something wrong like that, her husband or guardian has the right to stop her; in fact it is his duty to do so. And Allaah knows best.