The Prophet (ﷺ) used to observe I'tikaf during ten days of Ramadan every year. But when the year in which he died, he observed I'tikaf for twenty days.
Sunan Abi Dawud Book 14, Hadith 154