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."
Narrated `Abdullah bin `Umar
I offered the prayer with the Prophet, Abu Bakr and `Umar at Mina and it was of two rak`at. `Uthman in the early days of his caliphate did the same, but later on he started praying the full prayer.
Narrated Haritha bin Wahab
The Prophet I led us in the prayer at Mina during the peace period by offering two rak`at.
Narrated `Abdur Rahman bin Yazid
We offered a four rak`at prayer at Mina behind Ibn `Affan . `Abdullah bin Mas`ud was informed about it. He said sadly, "Truly to Allah we belong and truly to Him we shall return." And added, "I prayed two rak`at with Allah's Apostle at Mina and similarly with Abu Bakr and with `Umar (during their caliphates)." He further said, "May I be lucky enough to have two of the four rak`at accepted (by Allah)."