I’tikaf means the seclusion of the fasting person in the mosque with the intention to stay there. The mosque must be one of those where there is an Imam and where obligatory prayers are performed.
The Holy Qur’an mentions the state of I’tikaf.
Prophet Muhammad (may the Lord greet and bless him) would observe I’tikaf every year during the last ten days of the month of Ramadan, beginning from his arrival to Medina and till his death.
Islamic scholars are unanimous in that performing I’tikaf during the last ten days of the month of Ramadan is Sunnah for men, i.e. a desirable action.
The importance of being in the mosque with the intention of I’tikaf lies in the fact that man especially when fasting retires from worldly problems for a certain period of time and gets an opportunity to analyse in peace the past year of his life, realize his mistakes, sins and to repent in the quiet of God’s House with peace in the soul that is at the moment in the body that is observing an obligatory fast in the sight of the Lord of the worlds. In the state of peace a believer can formulate and develop certain plans for the following months and years asking God the Most High for blessing and help in the achievement of the set goals.
It is of primary importance for a man, who spends several or all the ten days in the mosque, to guard himself from idle talk and devote these days to the purification of his soul from vices, foibles and flaws. For all our sins are conceived there, in our hearts. And, of course, man, this weak human being, often unable to surmount difficulties, should ask and invoke God the Most High to strengthen himself in faith, piety and assiduity.
It is especially advisable during I’tikaf to read the Holy Qur’an and multiply one’s religious knowledge.
Question: Is it allowed to spend not all ten days, but, for example, only one of the nights in the mosque with the intention of I’tikaf?
Answer: Yes, it is. The point is that when entering the mosque you should have the intention (niyyah) to stay there with the intention of I’tikaf.
During the days of I’tikaf even if you decide to go to the mosque for a short period of time, it’s better that when entering the House of Allah the Most High you should be filled with the intention to spend these minutes or hours in the state of I’tikaf.
 All Islamic scholars emphasized that having the intention is obligatory in this case. See, for example: Az-Zuhayli W. Al-fiqh al-islami wa adillatuh: 11 volumes. Volume 3, p. 1751.
 “But do not associate with your wives while you are in seclusion (I'tikaf) in the mosques” (see, the Holy Qur’an, 2:187).
 See: Al-‘Askalani A. Fath al-bari bi sharh sahih al-bukhari: 14 volumes. Volume 4, p. 318, hadith Â¹ 2025, 2026; az-Zuhayli W. Al-Fiqh al-islami wa adillatuh: 11 volumes. Volume 3, p. 1751.
 See, for example: Az-Zuhayli W. Al-fiqh al-islami wa adillatuh: 11 volumes. Volume 3, p. 1752.