I’tikaf means staying in the mosque for a specific purpose, which is to worship Allah for a certain number of days in accordance with the believer's own wish. It is prescribed in Islam and is mustahabb (recommended) according to the consensus of the scholars.
The time for I'tikaf could be anytime when one is allowed to fast. The best time is the month of Ramadan, especially, the last ten days.