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
Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) used to observe i'tikaf in the last ten (days) of Ramadan. One year he (peace and blessings be upon him) was on a journey and could not observe i'tikaf, so the following year he (peace and blessings be upon him) observed i'tikaf for twenty days.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 8564
Sayyiduna Anas (may Allah be pleased with him) narrates that when he (peace and blessings be upon him) was resident, he would observe i'tikaf for ten days in the last ten, and when he (peace and blessings be upon him) travelled, he observed i'tikaf for twenty days the following year.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 8565