If there is no danger or legitimate excuse, women go to the mosque to pray in congregation. The Messenger of Allah ﷺ permitted women to go to the mosque and commanded men to permit their wives to go to the mosque. The Messenger of Allah ﷺ said:
إذا استأذنت امرأة أحدكم فلا يمنعها
“If the wife of any of you asks his permission to go (to the mosque), he should not stop her.”
It is narrated from Ibn Umar (may Allah be pleased with them both) that the Prophet ﷺ said:
إذا استأذنكم نساؤكم بالليل إلى المسجد فأذنوا لهن
“If your wives ask your permission at night to go to the mosque, then give them permission.”