Narrated Ibn `Abbas
The Prophet (ﷺ) once stayed for nineteen days and prayed shortened prayers. So when we travel led (and stayed) for nineteen days, we used to shorten the prayer but if we traveled (and stayed) for a longer period we used to offer the full prayer.
Narrated Yahya bin 'Is-haq
I heard Anas saying, "We traveled with the Prophet (ﷺ) from Medina to Mecca and offered two rak`at (for every prayer) till we returned to Medina." I said, "Did you stay for a while in Mecca?" He replied, "We stayed in Mecca for ten days."