A Sunnah prayer () is an optional or supererogatory salah (ritual prayer) that can be performed in addition to the five daily salah, which are compulsory for all Muslims. Sunnah prayer have different characteristics: some are done at the same time as the five daily compulsory prayers, some are done only at certain times (e.g. late at night), or only for specific occasions (e.g. during a drought); some have their own name (e.g. Tahajjud) and some are identified by how they are performed (e.g. "4 (rakat) before Zuhr and 2 after").  The length of Sunnah prayer also varies.

While the five daily salah are wajib/fard (obligatory), Sunnah prayer (and other sunnah deeds) are Mustahabb (encouraged) – those who perform them will earn a reward in the afterlife, but there will be no punishment for neglecting them.

Sunnah (in mainstream Islam), means the traditional customs and practices that (are believed to) follow the example of the Prophet of Islam Muhammad.  According to the stories, narrations, interpretations, of Muslim tradition, all of these prayers were originally performed by Muhammad (in addition to the five daily obligatory prayers).

Differences
Compared to regular compulsory prayer
Sohaib Sultan states that the steps for Sunnah prayer (Takbir, al-Fatihah, etc.) are exactly the same as for  five daily obligatory (fard) prayers, but varying depending on the prayer are the number of rakat (also rakʿah ( , ; plural:  ), which is a unit of prayer.

Prayers done only at certain times
Tahajjud and Tarawih are night prayers, Tarawih is only done during Ramadan. (see below)

Prayers done for specific occasions
Salat ul istasqa is a prayer to ask God for rain. Kusuf is done during a solar eclipse; Khusuf during a lunar eclipse. (see below)

Sunnah prayer which are done at the same time as regular compulsory prayer 
According to Sohaib Sultan, the Islamic prophet Muhammad performed Sunnah prayer  "before and/or after every obligatory prayer" to gain more blessings and benefits from Allah. Examples of these Sunnah mu’akkadah or "confirmed" sunnah prayer, as established in the Hanafi school of fiqh, (according to Faraz Rabbani)  include: 
 "2 rakats before Fajr"
 "2/4 rakats before Zuhr and 2 after"
 "2/4 rakats before Asr 
 "2 rakats after Maghrib"
 "2 rakats after Isha"

These sunnah prayer don't have a special name. Fajr, Zuhr, Asr, Maghrib, Isha are all names of compulsory prayers. A rakat—also rakʿah ( , ; plural:  ) -- is the movement from standing, to bowing on the floor, to standing again, that is part of every salat prayer.

Confirmed and non-confirmed prayers
Another division between non-obligatory prayers is whether they are "confirmed" or "unconfirmed": 
Sunnah mu’akkadah or "confirmed sunna" prayers,  which Muhammad "continuously performed and almost never abandoned" (according to tradition). Examples of Sunnah mu’akkadah include "Eid prayer, or the two rakat after the maghrib prayer".
Ghair mu’akkadah or "non-confirmed sunnas". These Muhammad was not as fastidious in performing as he sometimes performed them "and sometimes abandoned" them.  An example of ghair mu’akkadah is two rakat before the Isha prayer.

These two kinds of prayer have "different terminology and rulings".
Some examples of unconfirmed sunnah prayers are
4 rakats after Zuhr (either by making the 2 confirmed sunna rakats 4, or separately),
4 or 2 rakats before Asr
6 rakats (salat al-awwabin) after Maghrib, ideally in sets of two (the confirmed sunna can be included as part of the 6 if one chooses)
2 rakats before Isha
4 rakats after isha (one can include the confirmed sunnas in this if one wishes).
(When the prayers duplicate the confirmed sunnahs mentioned above they can be included with the confirmed sunnah prayers or not.)

Sunnah of prayer
Sunnah prayer is not to be confused with Sunnahs of prayer. Not only are there obligatory and optional types of prayer,  but  obligatory and optional parts (words and actions) of a prayer (at least for conservative Salafi Muslims such as Muhammad Salih al-Munajjid).

Examples of obligatory and "pillar" words and actions include: 
i. Standing during obligatory prayers if one is able to do so; 
ii. The opening takbeer i.e. saying “Allaahu akbar”; 
iii. Reciting al-Faatihah at the beginning of the rakat

Examples of sunnah words and actions include:
i. Saying after the opening takbeer, “Subhaanaka Allaahumma wa bi hamdika, wa tabaaraka ismuka, wa ta’aala jadduka wa laa ilaaha ghayruka (Glory and praise be to You, O Allaah; blessed be Your name, exalted be Your Majesty, and there is no god but You).” This is called du’aa’ al-istiftaah (opening du’aa’)
ii. Seeking refuge with Allaah
iii. Saying Bismillaah
iv. Saying Ameen

Tahajjud

Tahajjud () prayer is performed at night time, and it is recommended that it be performed after first going to sleep for a part of the night. Scholars have different opinions about whether sleeping first is absolutely required or not. In Saudi Arabia during the fasting month of Ramadan, there are many people who leave the Tarawih prayers in the main masjid in a hurry so that they can go home, go to sleep, and then wake up to perform their Tahajjud prayers in the early morning. Others simply stay in the mosque and perform these optional prayers before going home.

The time for the Tahajjud prayers falls between the prayer times of the isha'a prayers and the fajr prayers. It is also recommended that the prayers be done in the last third of the night. Muslims believe that the reward is greater for those who do this prayer at a later time. (It is harder to wake up and pray early in the morning, making the person's effort greater, resulting in a greater reward from God.)

Each prayer for a Muslim is made up with repeated actions and at least one rakat. The Tahajjud prayer consists of a minimum of one rakat and the maximum number 11. Some say 13 but any number more than 13 is a bidah (Innovation); for there is no hadeeth; that is saheeh (strong) showing that  Muhammad exceeding more than 13 rakats (according to Abu ‘Abdullah Muhammad ibn Nasr al-Marwazee)

It is reported about the Messenger of Allah (Allah bless him and give him peace) that he said: "Adhere to night prayer, for it is the habit of the righteous before you, and a means of drawing nearer to your Lord; it is an expiation for sins, and a deterrent from wrongdoing." [Tirmidhi & al-Hakim]

Abdullah ibn Amr ibn al-'As (Allah be pleased with him) relates that the Messenger of Allah (Allah be pleased with him) said to him, "O Abdullah, do not be like so-and-so, he used to pray in the night then he abandoned night prayer." [Bukhari & Muslim]

It is recommended that tahajjud be prayed during the last third of the night, but performing it at any other time is better than not performing it at all.

Tarawih

Tarawih () is a sunnah muakada night prayer during Ramadan. It is prayer that is only done during the Muslim fasting month of Ramadan. It can be done alone, in a group, at home, or in a mosque or other public meeting area it does not matter. Typically, Muslims gather together and perform tarawih as a group, often amongst extended family members in one large house. Others may meet in their local mosque, a meeting hall, or even in an outdoor field. Depending on the country, the tarawih prayers might be done in mosque by men only, or by a mixture of men and women (although physically separated from each other). The number of rakat of Tarawih salah is Twenty. Muhammad was afraid that if he continued to perform the prayers in the mosque, then his followers might come to think that they were compulsory and not optional.

After Muhammad, Taraweeh was Still prayed by 20 rakats. The issue that people make that he prayed 8 is about Tahajjud (salah ). In the main mosque in Mecca, the Imam (prayer leader) performs twenty rakat and then you pray your isha witr prayers. The total number of people joining the tarawih prayers in the main mosque in Mecca may reach 3-4 million. They fill up all levels inside the mosque, the flat roof, outside in the courtyard, some nearby streets (which are closed off), and on occasions even using up space in the lobbies of some nearby hotels.

It is also customary for the Imam in any mosque to recite the entire contents of the Qur'an during the fasting month by reading approximately one section per day. This practice of reading the Qur'an completely is known as khatm (complete recitation).

Istisqa

Salat ul istasqa () is a prayer to ask Allah for rain. It consisting of two rakat.  According to Ibn Qudaamah said: "Prayer for rain is a confirmed Sunnah, proven by the practice of the Messenger of Allah ... and of his successors."

The imam prays, with the followers, two rakat during any time except those times in which it is not desirable to pray. In the first rakat, the imam recites Sura Al-A'la after Sura Al-Fatiha. And in the second rakat, he reads Sura Al-Ghashiyah after Al-Fatihah, and he delivers a khutbah before or after the salah. As soon as he finishes the khutbah (sermon), people face the qiblah (direction of prayer) and supplicate to Allah. It was first introduced in Medina in the month of Ramadan of 6th Hijrah.

There are a number of hadith of Muhammad talking about praying for rain. Ash-Shaf'i states that it has been related from Salim ibn 'Abdullah, on the authority of his father that Muhammad would say for ishsqa': 
"O Allah, give us a saving rain, productive, plentiful, general, continuous. O Allah, give us rain and do not make us among the despondent. O Allah, (Your) slaves, land, animals, and (Your) creation all are suffering and seek protection. And we do not complain except to You. O Allah, let our crops grow, and let the udders be refilled. Give us from the blessings of the sky and grow for us from the blessings of the earth. O Allah, remove from us the hardship, starvation, and barrenness and remove the affliction from us as no one removes afflictions save Thee. O Allah, we seek Your forgiveness as You are the Forgiving, and send upon us plenteous rains." Ash-Shaf'i said: "I prefer that the imam would supplicate with that (prayer)."

Sa'd reported that for ishsqa', Muhammad would supplicate: "O Allah, let us be covered with thick clouds that have abundant and beneficial rain, frequently making a light rain upon us and sprinkling upon us with lightning. O Allah, You are full of majesty, bounty and Honour." This is related by Abu 'Awanah in his Sahih.

'Amr ibn Shuaib relates from his father, on the authority of his grandfather, that for istisqa', Muhammad would say: "O Allah, provide water for Your slaves and Your cattle, display Your mercy and give life to Your dead lands." This is related by Abu Dawud.

It is preferred for the one who is making this supplication to raise his hands with the back of his hands toward the sky. Muslim records from Anas that Muhammad would point with the back of his hands during ishsqa.

It is also preferred, upon seeing the rain, to say: "O Allah, make it a beneficial rain" and he should uncover part of his body to the rain. On the other hand, if one fears that there is too much rain, one should say: "O Allah give us mercy and do not give us punishment, calamities, destruction or flooding. O Allah, make it upon the woods, farms and trees. Make it around us and not upon us."

Kusuf and Khusuf (Solar and Lunar Eclipse)

Salat ul-Kusuf () is a prayer offered during a solar eclipse; Salat ul-Khusuf () is performed during a lunar eclipse. They are  both Nafl (non-obligatory) with two rakat prayers that should be performed by the Muslim community in congregation.

Two or four Rakat (Units) of Khusuf salah are offered in a Jama'ah (Group) or individually, with individual prayers preferred. Neither Adhan (Call for Prayers) nor Iqamah (Second Call for Prayers) is called for Khusuf salah. Recitation of the Quran during Khusuf salah can be done either silently or loudly.

During the time of Muhammad, there was a solar eclipse. People hurried to link this to a worldly event, namely, the death of Muhammad's son, Ibrahim. Muhammad explained the truth of this matter to them. In his Sahih (authentic hadith), Imam Muslim reported that `A'ishah (rali) said: 
There was a solar eclipse in the time of the Messenger of Allah. He stood up to pray and prolonged his standing very much. He then bowed and prolonged very much his bowing. He then raised his head and prolonged his standing much, but it was less than the (duration) of the first standing. He then bowed and prolonged bowing much, but it was less than the duration of his first bowing. He then prostrated and then stood up and prolonged the standing, but it was less than the first standing. He then bowed and prolonged his bowing, but it was less than the first bowing. He then lifted his head and then stood up and prolonged his standing, but it was less than the first standing. He then bowed and prolonged bowing and it was less than the first bowing. He then prostrated himself; then he turned about, and the sun had become bright, and he addressed the people. He praised Allah and lauded Him and said: "The sun and the moon are two signs of Allah; they are not eclipsed on account of anyone's death or on account of anyone's birth. So when you see them, glorify and supplicate Allah, observe the Prayer, give alms. O Ummah of Muhammad, none is more indignant than Allah when His servant or maid commits fornication. O people of Muhammad, by Allah, if you knew what I know, you would weep much and laugh little. O Allah, witness, I informed them."

See also
 Nafl prayer
 Salatut Tasbih

References

Salah
Salah terminology