BUKHARI 2044: from Abū Hurayrah —
The Prophet ﷺ used to perform Iʿtikaf every year in the month of Ramadan for ten days, and when it was the year of his death, he stayed in Iʿtikaf for twenty days.

البخاري ٢٠٤٤: عن ابو هريره —
كَانَ النَّبِيُّ ﷺ يَعْتَكِفُ فِي كُلِّ رَمَضَانَ عَشْرَةَ أَيَّامٍ فَلَمَّا كَانَ الْعَامُ الَّذِي قُبِضَ فِيهِ اعْتَكَفَ عِشْرِينَ يَوْمًا


Sound (Bukhārī)
Bukhārī > Iʿtikāf (Retiring to a Mosque for Remembrance of Allah) > § I'tikaf in the middle ten days of Ramadan
hadithunlocked.com