Sunnah Prayers: the Rawatib Before and After the Obligatory Prayers
The sunnah prayers that go with the obligatory ones, before and after them. The number is ten rak'ahs in the hadith of Ibn Umar and twelve in the hadith of Umm Habibah.
Ibn Umar said:
حَفِظْتُ مِنَ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَشْرَ رَكَعَاتٍ رَكْعَتَيْنِ قَبْلَ الظُّهْرِ، وَرَكْعَتَيْنِ بَعْدَهَا، وَرَكْعَتَيْنِ بَعْدَ المَغْرِبِ فِي بَيْتِهِ، وَرَكْعَتَيْنِ بَعْدَ العِشَاءِ فِي بَيْتِهِ، وَرَكْعَتَيْنِ قَبْلَ صَلاَةِ الصُّبْحِ
I memorised from the Prophet ten rak'ahs: two before Dhuhr, two after it, two after Maghrib in his house, two after Isha in his house, and two before the morning prayer.
The hadith of Umm Habibah
Umm Habibah said that she heard the Messenger of Allah (peace be upon him) say:
مَنْ صَلَّى اثْنَتَيْ عَشْرَةَ رَكْعَةً فِي يَوْمٍ وَلَيْلَةٍ بُنِيَ لَهُ بِهِنَّ بَيْتٌ فِي الْجَنَّةِ
Whoever prays twelve rak'ahs in a day and night, a house will be built for him in Paradise because of them.
Umm Habibah said: "I have not left them since I heard that from the Messenger of Allah" (Sahih Muslim 728). In the report of at-Tirmidhi 415, graded sahih by al-Albani, the twelve are listed: four before Dhuhr, two after it, two after Maghrib, two after Isha and two before Fajr. That agrees with the hadith of Ibn Umar in all it mentions and adds two rak'ahs before Dhuhr. Aishah said that the Prophet never left four before Dhuhr and two before dawn (Sahih al-Bukhari 1182).
What the rawatib are
The rawatib are the voluntary prayers that go with each obligatory prayer. Voluntary prayers that are not tied to an obligatory one include the night prayer, Duha and tahiyyatul masjid, and many of them have their own pages on this site.
The two rak'ahs of Fajr
Aishah said that the Prophet said: "The two rak'ahs of Fajr are better than the world and all that is in it" (Sahih Muslim 725). Fajr is on the page Fajr prayer.
Dhuhr, Asr, Maghrib and Isha
For Dhuhr, two before and two after are in the hadith of Ibn Umar. Four before are in the hadith of Aishah (Sahih al-Bukhari 1182) and the hadith of Umm Habibah (at-Tirmidhi 415), and the details are on the page Dhuhr prayer. For Asr there is no regular sunnah in the hadith of Ibn Umar, and there is a hadith urging four before it (Abu Dawud 1271, graded hasan by al-Albani), on the page Asr prayer. For Maghrib it is two after it at home, and two before it for whoever wishes (Sahih al-Bukhari 1183). For Isha it is two after it at home.
At home
Ibn Umar said that the two rak'ahs of Maghrib and the two of Isha were prayed in the Prophet's house. The hadith of Zayd ibn Thabit urges voluntary prayer at home (Sahih al-Bukhari 731).
Questions about the sunnah prayers
How many rak'ahs are the sunnah prayers?
Ten in the hadith of Ibn Umar and twelve in the hadith of Umm Habibah.
Are the rawatib obligatory?
The hadiths urge them and do not make them obligatory.
What is the difference between the rawatib and other voluntary prayers?
The rawatib go with an obligatory prayer, before or after it. An unrestricted voluntary prayer has no fixed time or number, like the night prayer or Duha.
When do I make up a missed sunnah?
For the two rak'ahs of Fajr there is a hadith about praying them after the obligatory prayer if they were missed (Abu Dawud 1267, graded sahih by al-Albani), on the page Fajr prayer. For the other rawatib the hadiths of Ibn Umar and Umm Habibah do not speak about making them up.