ENOfficial
Narrated Ibn 'Abbas: Allah, the Exalted, prescribed prayer for you, through the tongue of your Prophet (ﷺ), four rak'ahs while resident, two rak'ahs while travelling and one rak'ah in time of danger.
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا مُسَدَّدٌ، وَسَعِيدُ بْنُ مَنْصُورٍ، قَالاَ حَدَّثَنَا أَبُو عَوَانَةَ، عَنْ بُكَيْرِ بْنِ الأَخْنَسِ، عَنْ مُجَاهِدٍ، عَنِ ابْنِ عَبَّاسٍ، قَالَ فَرَضَ اللَّهُ تَعَالَى الصَّلاَةَ عَلَى لِسَانِ نَبِيِّكُمْ صلى الله عليه وسلم فِي الْحَضَرِ أَرْبَعًا وَفِي السَّفَرِ رَكْعَتَيْنِ وَفِي الْخَوْفِ رَكْعَةً .
sunnah.com