I'tikaf means seclusion or isolating for worship. It is considered a sunnah or a strongly recommended practice--especially during the last ten days of Ramadhan..
The purpose of I'tikaf is to attain spiritual purification by developing self-discipline, concentration in worship and mindfulness of Allah. It involves keeping oneself away from worldly distractions as best as possible.
As for the legal status of 'I'tikaf it can be either obligatory or recommended; it is considered obligatory when one has made a vow to do so, for we are to fulfil our vows. Otherwise, It'ikaf is simply recommended.
While scholars disagree on some of the minor details of the rules and etiquettes of I't'ikaf, all of them agree that iitkaf proper should be performed in a jami or a mosque where jumu'ah is held. Imam Abu Hanifah, however, adheres to the view that it is fine for a woman to do I'tikaf in the musalla of her own home.
Some scholars do not consider fasting to be a condition for I'tikaf; however, the majority, do think so. The former view is attributed to Imams Shafi and Ahmad, and the latter one to Imams Abu Hanifah, Malik, Awza'i and others.
I'itkaf proper involves isolation. The Prophet (peace be upon him) used to have a specific spot (something like a small tent) set aside for him in the mosque to which he retreated during 'i'itikaf. He did come out of the area only for prayer or essential chores such as purification and answering the call of nature, etc. During I'tikaf the Prophet did not visit the sick or attend funerals, or have conjugal relations with his wife--although he did converse with them briefly on occasions when they visited him.
Let me state briefly some of the rules and etiquettes of I'tikaf:
1. As for the number of days, one may spend any number of days; but while sitting for i''itkaf in ramadhan, it is recommended to do so during the last ten days. If, however, a person cannot afford to do one may sit any number of days, for something is better than nothing.
2. It is important for those who wish to sit in I'tikaf to formulate the niyyah to do so; if one has vowed to sit in a particular mosque such as the Haram of Makkah or Madinah one should fulfil his vow;
3. He should also make sure to devote the time exclusively for dhikr, salah, du'as, and reading of the Qur'an. He may, however, attend sessions of beneficial religious knowledge;
4. One should refrain from all frivolous words or actions as well as unnecessary worldly conversations;
5. It is not allowed to go out of the mosque for other than performing the most basic chores such as using the facilities to answer the call of nature, etc.
Finally, I pray to Allah to help us all to strive to purify our hearts by developing concentration in worship and mindfulness of Allah.