First of all, it is to be noted that the idea behind i`tikaf (spiritual retreat in the mosque) is to exhort the Muslims to devote themselves exclusively to prayer and devotion at least for a few days during the year in order to develop deep Allah-consciousness, because it is this consciousness which is the fountainhead of a Muslim’s thought and deed. I`tikaf is, in fact, the next stage of fasting in spiritual development and purification of the soul. During the days of i`tikaf, the mu`takif (one who enters in the state of i`tikaf) dissociates himself from all worldly affairs and spends his time in prayer and supplication.
Sheikh Sayyed Sabiq states in his well-known book, Fiqh As-Sunnah: “There is a difference of opinion among the jurists concerning which mosques are acceptable for i`tikaf. According to Abu Hanifah, Ahmad, Ishaq, and Abu Thawr, i`tikaf is valid in any mosque in which the five prayers are held, and which has a congregation. This is based on the hadith of the Prophet (peace and blessings be upon him): “Every mosque that has a caller to prayer and an imam is acceptable for i`tikaf.” (Reported by ad-Daraqutni)
Imam Malik, ash-Shafi`i, and Dawud say that it is acceptable in any mosque, as there is no proof that restricts it to any particular mosques. The Shaf`i followers say it is better to perform i`tikaf in a Jami` mosque (in which the Jum`ah prayer is performed), as the Prophet (peace and blessings be upon him) performed i`tikaf in such a mosque, and because the number of those who attend the prayers in such a mosque is greater. If the period of i`tikaf includes the time for the Jum`ah prayer, then one must perform it in the Jami` mosque in order not to miss the Jum`ah prayer.
Most scholars say that it is not correct for a woman to make i`tikaf in the mosque in her house (that is, the special place of her house where she performs her prayers) because the mosque in her house usually does not fall in the category of mosques and can be sold.”