All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Observing I‘tikaaf (i.e. seclusion in the mosque for the purpose of worship) is an act of Sunnah which was prescribed by the Prophet, sallallaahu ‘alayhi wa sallam. He, sallallaahu ‘alayhi wa sallam, observed I‘tikaaf and his wives did the same after his death. It is better for a Muslim to observe I‘tikaaf on the last ten days of Ramadan.
There is nothing wrong with one observing I‘tikaaf for a part of this period not the entire period. One may also observe I‘tikaaf on the nights apart from the days. Hence, whenever a worshipper enters the mosque, he should hold the intention of observing I‘tikaaf. However, when one leaves the mosque for work or so on, one's I‘tikaaf is interrupted. He simply needs to renew his intention of I‘tikaaf when he returns to the mosque and he will be rewarded for the periods of time during which he observes I‘tikaaf in the mosque.
For more benefit, please refer to Fatwa 111803.
Allaah Knows best.