ENOfficial
It was narrated that Ibn 'Abbas said: "Allah, the Mighty and Sublime, enjoined the prayer on the tongue of your Prophet (ﷺ): While a resident four (rak'ahs), while traveling two, and at times of fear one."
Source: sunnah.com
Other translations
Arabic
أَخْبَرَنَا يَعْقُوبُ بْنُ مَاهَانَ، قَالَ حَدَّثَنَا الْقَاسِمُ بْنُ مَالِكٍ، عَنْ أَيُّوبَ بْنِ عَائِذٍ، عَنْ بُكَيْرِ بْنِ الأَخْنَسِ، عَنْ مُجَاهِدٍ، عَنِ ابْنِ عَبَّاسٍ، قَالَ إِنَّ اللَّهَ عَزَّ وَجَلَّ فَرَضَ الصَّلاَةَ عَلَى لِسَانِ نَبِيِّكُمْ صلى الله عليه وسلم فِي الْحَضَرِ أَرْبَعًا وَفِي السَّفَرِ رَكْعَتَيْنِ وَفِي الْخَوْفِ رَكْعَةً .
sunnah.com