Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
The time of Maghrib prayer begins with the disappearance of the sun and lasts until the red twilight ends.
In his famous work, Fiqh As-Sunnah, Sheikh Sayyid Sabiq, elaborates on the subject as follows:
The time for the Maghrib prayer begins with the disappearance of the sun and lasts until the red twilight ends.
`Abdullah ibn `Amr (may Allah be pleased with him) reported that the Prophet (peace be upon him) said, “The time for the Maghrib prayer is when the sun has disappeared and the twilight has not gone.” (Muslim)
Abu Musa (may Allah be pleased with him) related that a man asked the Prophet about the prayer times, and he mentioned the hadith which states that he ordered the Maghrib prayer when the sun had set and, on the next day, he prayed it when the red twilight was ending and he said, “The time (for the Maghrib prayer) is between these two times.”
An-Nawawi says in his commentary on Sahih Muslim:
“It is the opinion of the research scholars of our companions (the Shafi`iyyah) that … it is allowed to delay Maghrib prayer as long as it is twilight. It is allowed to begin the prayer at any time during that period. There is no sin in delaying it from its earliest time.”
Concerning the earlier quoted hadith in which Gabriel led the prayers and prayed the Maghrib prayer at the same time on both days, it only shows that it is greatly preferred to perform the Maghrib prayer as early as possible. This point is made clear by some other hadiths:
As-Sa’ib ibn Yazid related that the Messenger of Allah (peace be upon him) said, “My nation will always be along the natural path as long as they pray the Maghrib prayer before the stars appear.” (Related by Ahmad and at-Tabarani)
In Ahmad’s Musnad, it is related from Abu Ayyub al-Ansari (may Allah be pleased with him) that the Prophet said, “Pray the sunset prayer when the fasting person breaks his fast and when the stars are about to appear.”
In Sahih Muslim, it is related from Rafi` ibn Khadeej that “We prayed the Maghrib prayer with the Messenger of Allah, and one of us would leave (afterwards) and would still be able to see where he shot his arrow, (because there was still so much light left in the sky).”
In Sahih Muslim, it is recorded from Salamah ibn al-Akwa` that the Messenger of Allah (peace be upon him) would pray the Maghrib prayer when the sun had set and disappeared ( behind the horizon).
Almighty Allah knows best.