It is customary every week on Ereb Shabbat to light candles approximately 18 minutes before sundown. On Ereb Yom Tob, however, different customs exist. On Yom Tob, unlike on Shabbat, it is permissible to light a candle from a preexisting flame, and so technically speaking, candles may be lit even after sundown. Indeed, on the second night of Yom Tob, according to all opinions and all customs, women light the Yom Tob candles after dark, before the meal, because it is forbidden to make any preparations for the second day of Yom Tob on the first night of Yom Tob. On the first night, however, it is unclear whether the women should light before sundown, as they do before Shabbat, or if they should light after dark, before the meal, as they do on the second night of Yom Tob.
This question actually has a fascinating history, beginning with a passage in the introduction to the Derisha, a work on the Tur by Rav Yehoshua Falk (1555-1614), a great Rabbi in Poland who also authored the Sama ("Sefer Me’irat Enayim") commentary on the Hoshen Mishpat section of the Shulhan Aruch. The introduction to the Derisha was written by the author’s son, who includes a description of both his parents. In discussing his mother, he describes her as an exceptionally pious and learned woman, who observed regular fasts for many years after her husband’s passing, and who was more proficient in the laws of family purity than many learned Rabbis. He relates that his mother disapproved of the widespread practice to light the Yom Tob candles on the first night of Yom Tob after dark, before the meal, like on the second night. She felt that this custom evolved mistakenly, as women were accustomed to lighting late on the second night of Yom Tob, so they began doing so also on the first night. In truth, however, in her view, the candles are to be lit after dark on the second night only because they cannot be lit earlier, due to the prohibition against preparing on the first day of Yom Tob for the second day. But fundamentally, the candles must be lit before sundown in honor of the holiday, just as the Shabbat candles are lit before sundown on Friday. Rav Falk’s son writes that he concurred with his mother’s reasoning.
These comments are cited by the Hida (Rav Haim Yosef David Azulai, 1724-1806), in his work Shem Ha’gedolim. He writes that Rav Falk’s wife is correct, adding, "Lo Mi’piha Anu Hayin" – we do not rely on her word alone, as several Poskim held this view.
The Hatam Sofer (Rav Moshe Sofer of Pressburg, 1762-1839) suggests drawing proof against this view from the Mishna’s ruling in the "Bameh Madlikin" chapter of Masechet Berachot, "En Madlikin Be’shemen Serefa Be’Yom Tob." This means that on Yom Tob, it is forbidden to light a candle using hallowed oil which had been become Tameh (impure) and must therefore be burned. The Gemara explains that this is based on the prohibition against burning hallowed food products (including oil) on Yom Tob. The Hatam Sofer notes that the Mishna and Gemara appear to work off the assumption that the lighting is taking place on Yom Tob, and not before Yom Tob. After all, the prohibition against burning "Shemen Serefa" quite obviously applies only on Yom Tob, and not before. This might prove, then, that it is proper to light the Yom Tob candles after dark, once Yom Tob has begun. The Hatam Sofer then refutes this proof, noting that once the woman recites the Beracha, this might constitute the onset of Yom Tob, such that it would then be forbidden to light a candle using "Shemen Serefa."
In any event, Hacham Ovadia Yosef, in Hazon Ovadia – Yom Tob, brings both customs – to light before sundown on the first night of Yom Tob, and to light after dark, before the meal – implying that both are acceptable.
It must be emphasized that if a woman lights after dark, she must light from a preexisting flame, as it is forbidden to strike a match on Yom Tob. Additionally, although some women have the custom when lighting Shabbat candles to first light the candles and then recite the Beracha (following the view of the Ben Ish Hai and the Rama), when it comes to the Yom Tob candles, everyone should recite the Beracha before lighting the candles. The reason for the custom to first light the candles on Ereb Shabbat is that the recitation of the Beracha might constitute the onset of Shabbat, at which point it is no longer permissible to light the candles. On Yom Tob, when lighting candles is allowed, this is irrelevant, and so according to all customs, the Beracha over the lighting of Yom Tob candles is recited before they are lit.
Summary: On the second night of Yom Tob, the candles are lit after dark, before the meal. They may not be lit earlier because of the prohibition against preparing on the first day of Yom Tob for the second day. On the first night of Yom Tob, some have the custom to light after dark, like on the second day, whereas others have the custom to light before sundown, like on Ereb Shabbat. It must be emphasized that on the second night of Yom Tob, and on the first night if one lights after dark, one must light from a preexisting flame, for although it is permissible to light a candle on Yom Tob, it is forbidden to create a new flame.