Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: "Allah made the prayer obligatory upon the tongue of your Prophet (peace and blessings be upon him): four rak'ahs when resident, two rak'ahs on a journey, and one rak'ah in a state of fear."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10997