The Shulhan Aruch (O.H. 293:2) rules that one should be careful not to perform any forbidden acts on Shabbat until one sees three small stars in the sky, and that the stars should not be scattered but rather in a close formation. Furthermore, if it is a cloudy night one should wait until one is reasonably confident that Shabbat is over. There are two main opinions regarding when Shabbat ends. The first is, as mentioned, when three stars are visible in the sky, which is roughly forty minutes after sunset, and is commonly attributed to the Geonim. The other opinion, commonly attributed to Rabbenu Tam, is that Shabbat ends the amount of time it takes to walk four Mil, or seventy two minutes, after sunset.
Rabbi Yitzhak Benoualid (Likute Dinim, vol. II, pg. 212) writes that the common Minhag in Morocco followed the opinion of the Geonim. Similarly, Rabbi Shlomo ibn Danan (Bakesh Shlomo, § 28) writes categorically that the custom is to follow the Geonim and Rabbi Raphael Encaoua (Tofaot Re’em, § 49) concurs. Rabbi Shalom Messas (Shemesh Umagen, vol. I, § 26) writes that the custom was always to follow the Geonim and that there was never a custom to follow the time of Rabbenu Tam. He goes on to write that if one wishes to be stricter and follow the time of Rabbenu Tam, one should do it privately and to not act in a way that suggests that those that follow the time of the Geonim are somehow violating Shabbat.
Interestingly, Rabbi Yismah Ovadia (Yismah Levav, § 10) of Sefrou writes that it is proper to be strict and adhere to the opinion of Rabbenu Tam. He cites Rabbi Menahem Nahon (Mishpatim Tzadikim § 132) of Tetouan who mentions the time of Rabbenu Tam, albeit in reference to calculating the Brit Mila of a child born after sunset on Friday.
The opinion of the Geonim is a universal one and is followed by many other communities besides the Moroccan one. The HIDA, (Birkei Yosef , §261) writes that the custom is to follow the opinion of the Geonim. Rabbi Abdullah Somekh (Zivhe Tzedek, § 103), the rabbi of the Ben Ish Hai and the Ben Ish Hai himself (Shana II, Parashat Vayetze) both write that this is the custom in Baghdad. Rabbi Tzadka Husain (Tzedaka Umishpat, Orah Haim, § 65) and Rabbi Avraham HaLevi (Ginat Veradim) attest to this being the custom in Syria and Egypt, respectively, as well. Finally, Rabbi David Yehudayoff (Yisrael Saba) writes that Baba Sale, who was normally very strict, did not deviate from the common custom and did not follow the approach of Rabbenu Tam.
Summary: The Moroccan custom is to follow the Geonim with regards to the end of Shabbat.