Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates: The Prophet Muhammad (peace and blessings be upon him) came to Makkah. He stayed there for seventeen days and during this period he performed shortened prayers (qasr). Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) says: Whoever stays at a place for seventeen days should perform shortened prayers, and whoever stays longer than that should perform complete prayers.
Hadith Referenceصحیح ابن حبان / كتاب الصلاة / 2750
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «صحيح أبي داود» (1104): ق بلفظ: تسع عشرة، وهو الأرجح.فضيلة الشيخ العلّامة شُعيب الأرناؤوطصحيح