Is it allowed to close the mosque outside the times of prayer?
Leaving the mosque open outside the prayer time is advised and more appropriate. It is encouraged to keep the masjid open. According to Imam Abu Hanifa “the masjid must be kept open day and night” according to the verse of Quran, “And who is more unjust than he who prevents (men) from the masjids of Allah, that His name should be remembered in them, and strives to ruin them?” [2: 114] – referring to those who oppress people by closing the masjid, and thereby prevent the mention of Allah’s name (dhikrullah).
Shaykh Muhammad Hisham Kabbani