There are a total number of seven rakats in the Maghrib prayer. 3 rakat farz, 2 rakats sunnah which are followed by optional 2 rakats of nafil.