Allaah has enjoined upon His slaves five prayers throughout the day and night at specific times decreed by the wisdom of Allaah so that the slave may be in contact with his Lord in these prayers throughout all of these times. They are for the heart like water for a tree, given to it time after time, not all in one go and then it stops.
Maghrib Salah (صلاة المغرب) is the third prayer among the 5 prayers for a Muslim. 
Maghrib(مغرب) - The obligatory salaah (formal prayers); that is performed right after the sun sets over the horizon. 
The times of the prayers were mentioned by the Prophet (ﷺ) in the hadeeth: “The time for Zuhr is from when the sun has passed its zenith and a man’s shadow is equal in length to his height, until the time for ‘Asr comes. The time for ‘Asr lasts until the sun turns yellow. The time for Maghrib lasts until the twilight has faded. The time for ‘Isha’ lasts until midnight. The time for Subh (Fajr) prayer lasts from the beginning of the pre-dawn so long as the sun has not yet started to rise. When the sun starts to rise then stop praying, for it rises between the two horns of the Shaytaan.” Sahih Muslim, 612
This hadeeth explains the timings of the five daily prayers.
The Prophet (ﷺ) said: “The time for Maghrib lasts until the twilight has faded.” Sahih Muslim 612 a
i.e., the time for Maghrib starts immediately after the time for ‘Asr ends, which is when the sun sets, until the twilight or red afterglow has faded. When the red afterglow has disappeared from the sky, the time for Maghrib ends and the time for ‘Isha’ begins. Defining this time by the clock varies according to the season. When you see that the red afterglow has disappeared from the horizon, this is a sign that the time for Maghrib has ended. 
Ibn 'Umar(R) reported that Allah's Messenger (ﷺ) combined the Maghrib and 'Isha ' prayers at Muzdalifa. He observed three rak'ahs of the sunset prayer and two rak'ahs of the 'Isha' prayer with one Iqama. The Book of Pilgrimage (Hajj), Sahih Muslim 1288
"Allaah will build a house in Heaven for whoever is diligent in observing 12 Sunnah Rak'aat (as follows): 4 Rak'aat before and 2 after the Dhuhr (Midday) Prayer, 2 after the Maghrib (Sunset Prayer), 2 after the ‘Ishaa’ (Evening) Prayer and 2 before the Fajr (Dawn) Prayer." At-Tirmidhi No. 414 and Ibn Majah Book 5, Hadith 1194 AndHadith No. 6183 & 6362 in Sahih al-Jaami’.
Narrated 'Abd Allah al-Muzani(R): The Messenger of Allah (ﷺ) said: Pray two rak'ahs before the Maghrib prayer. He then said (again): Pray two rak'ahs before the Maghrib prayer, it applies to those who wish to do so. That was because he feared that the people might treat it as sunnah.Sunan Abi Dawud 1281 
Salim reported from his father(Abdullah ibn Umar) to be saying: I saw the Messenger of Allah (ﷺ) combining the sunset and Isha' prayers when he was in a hurry on a journey.Sahih Muslim 703
Mu'adh b. Jabal reported:The Messenger of Allah (ﷺ) combined in the expedition to Tabuk the noon prayer with the afternoon prayer and the sunset prayer with the 'Isha' prayer. He (one of the narrators) said: What prompted him to do that? He(Mu'adh) replied that he (the Prophet) wanted that his Ummah should not be put to (unnecessary) hardship. Sahih Muslim 706and Sunan Abi Dawud 1211
Ibn Abbas said: "Allah'sMessengerﷺcombined the Zuhr and Asr (prayers), and the Maghrib and Isha (prayers) in Al-Madinah, without being in a state of fear, nor due to rain." Jami` at-Tirmidhi 187