Shabbat is over when three medium stars appear in the sky. This is shortly after sunset, however the exact timing is a big debate among the rabbis. The timing also depends on the location. In Baghdad for example, the Ben Ish Hai (Rabbi Yosef Haim, Baghdad 1833-1869) writes that they would wait until 37 minutes after sunset. In Aleppo, they would wait until 35 minutes after sunset. These timings were unique to the Middle East where it got dark early. In New York and New Jersey where it gets dark later one should wait till 42 minutes after sunset.
Hacham Obadia Yosef writes that one should try to follow the opinion of Rabbenu Tam (France, 1100-1171) to wait till 72 minutes after sunset. If one can’t follow this opinion to refrain from all labor forbidden on Shabbat he should at least follow this opinion to refrain from labors which are forbidden biblically. Rabbi Moshe Feinstein (1895-1986) writes that in Europe where Rabbenu Tam lived it took longer for it to get dark. Accordingly, Rabbenu Tam’s 72 minutes in New York time where it gets darker faster, would be equivalent to 50 minutes.
Rabbi Shelomo Zalman Auerbach (Jerusalem, 1919-1995) writes that if one who follows Rabbenu Tam’s opinion heard or said the Habdallah before this time he fulfills his obligation even though it is still Shabbat for him.