Sahih Bukhari | Volume 3 | Hadith Number 260

Narrated by Abu Huraira
The Prophet used to perform Itikaf every year in the month of Ramadan for ten days, and when it was the year of his death, he stayed in Itikaf for twenty days.