Sayyiduna Abu Hurayrah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) used to observe i'tikaf for ten days every Ramadan, but in the year in which he (peace and blessings be upon him) passed away, he (peace and blessings be upon him) observed i'tikaf for twenty days.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 8563