Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
It is more appropriate and better for a woman not to leave her home except for a dire necessity. Allah says: "And stay in your houses, and do not display yourselves like that of the times of ignorance… (Al-Ahzab 33:33)
It is better for a woman to pray in her home than to pray in the mosque. Imam Ahmed reported in his Musnad that Um Hamid, the wife of Abu Hamid Al-Saidi, came to the Prophet (Sallallahu Alaihi wa Sallam) and told him, O Prophet (Sallallahu Alaihi wa Sallam) of Allah, I like praying with you." He said: "I had known that you like praying with me. But your prayer in your private room is better than your prayer in other rooms of your house, and your prayer in other rooms of your house is better than your prayer in the halls of your house, and your prayer in the halls of your house is better than your prayer in your community's mosque, and your prayer in your community's mosque is better than your prayer in my mosque."
So this is a proof that the more the place is more secret and private for the woman and far from men, the better for her.
However, it is incumbent upon a Muslim woman to learn her creed, the rulings pertaining to her acts of worship and the etiquettes of her religion. If this is possible in her house, then it is better for her without doubt, but if this is not permissible except outside her home, and there is no other way except by staying overnight in the mosque, or the vicinity of the mosque, then there is no harm for this, provided she abides by the Islamic jurisprudence requirements and she is far away from anything that causes her to be tempted. Being tempted, is easy because the possibility of girls being subjected to what is dislikable in such camps, is high, therefore it is more appropriate for her to avoid this.
And the woman in menses should not stay in the mosque as the Prophet (Sallallahu Alaihi wa Sallam) forbade that.
Allah knows best.