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. (Using translation from Abū Dāʾūd 2466)
كَانَ رَسُولُ اللهِ ﷺ يَعْتَكِفُ فِي كُلِّ رَمَضَانَ عَشَرَةَ أَيَّامٍ فَلَمَّا كَانَ الْعَامُ الَّذِي قُبِضَ فِيهِ اعْتَكَفَ عِشْرِينَ يَوْمًا