Can a woman in menstruation or postnatal period enter mosques?
According to a great majority of Muslim scholars, it is not permissible for women in menstruation or postnatal period to enter mosques (Mawsili, al-Ikhtiyar, I, 73-74; Mawwaq, al-Taj, I, 552; Shirbini, Mughni al-Muhtaj, I, 119).
The conditions of menstruation and postnatal period are considered as ritual impurity in Islam and they prevent one from performing certain acts of worship. Mosques are places of worship. The Prophet Muhammad (saw) said, “I do not consider a menstruating or junub person to enter a masjid/be in masjid as halal.” (Abu Dawud, Taharah, 94; Ibn Khuzaymah, Sahih, II, 284); “Masjid is not halal to those who menstruate and are junub” (Ibn Majah, Taharah, 126). Some scholars think that it is permissible for a woman who menstruates to enter a mosque when necessary, e.g. in order to pick up something in the mosque or walk through it if her road will be shorter in this way. (Ibn Qudamah, al-Mughni, I, 166; Shirbini, Mughni al-Muhtaj, I, 119). Hanafis also say that it is permissible for a junub person to walk through a masjid on condition that s/he performs tayammum, and that s/he may stay there as long as it is needed (Kasani, Bada’i, I, 38). One of the grounds of this opinion is Prophet Muhammad’s (saw) asking Aisha to extend a cover to masjid when she was menstruating (Muslim, Haidh, 11; Abu Dawud, Taharah, 105). According to an opinion from Hanbalis, those who menstruate or are in postnatal period may enter a masjid on condition that they perform minor ablution (Mardawi, al-Insaf, I, 347). According to Zahiris, a woman who menstruates may enter a masjid and stay there (Ibn Hazm, al-Muhalla, V, 196). One may adopt these views when needed.
These rulings about the persons who menstruate or are in postnatal period are valid for the places that are constructed as masjids by being surrounded with walls or other things and in which it is proper to perform itikaf. Therefore, the places situated in the yards of masjids and outbuildings, and are used by the congregation when needed, are evaluated differently. These places are not subject to the rulings on masjid in this subject, according to the authentic opinion from Hanafis, Malikis, and Hanbalis (See. al-Mawsuat al-Fiqhiyya, V, 224).
Source: Presidency Of Religious Affairs The Turkey, High Board of Religious Affairs FATWAS