Sayyiduna Anas (may Allah be pleased with him) narrates: When the Prophet (peace and blessings be upon him) was residing, he used to observe i'tikaf during the last ten days of Ramadan, and when he was in a state of travel, then in the following year he would observe i'tikaf for twenty days.
Hadith Referenceصحیح ابن حبان / كتاب الصوم / 3662
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «صحيح أبي داود» (2126): خ - أبي هريرة.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط الشيخين