Sahih Muslim, Book 6, Hadith 6 (Muslim 1561)

Ibn 'Abbas reported:

Allah has prescribed the prayer through the word of your Prophet (ﷺ) as four rak'ahs when resident, two when travelling, and one when danger is present.