On the Friday afternoon of Hanukkah, we light Hanukkah candles before lighting the Shabbat candles, even though one doesn't necessarily accept Shabbat with the lighting of the Shabbat candles, because there are those who do, and there's a possibility that a person will do so. So we put the Hanukkah candles first. One has to make sure there's enough oil for the candles to last for at least a half hour following Tzet HaKochavim (nightfall), right? So that means that you have to get up to sunset. Usually, you're going to light about 20 minutes before sunset, right before you light Shabbat candles. Then you have to get from sunset to nightfall, which is another 20 minutes, and then another half hour. So a person has to make sure they have approximately an hour and 10 minutes or so of oil, so the candles can last for a half hour after Tzet HaKochavim.
What sometimes causes people a problem is that they have these pre-made oil canisters that last for two hours, two and a half hours, and the person is going out to eat at a friend's house on Friday night. They don't want to light the candles in their home because they don't want to leave them lit without anybody else home, which they shouldn't. It's not safe to do so. So now they have a problem because they don't know where to light. They want to be able to light at home, but they don't want to leave the candles burning without anybody home. So what should they do? A person should either think ahead of time and not eat out on Friday night in that situation, or they have to try to empty out some of the oil so the candles will go out by the time they're ready to leave home to go to their friend. What they cannot do is participate in their friend's lighting where they're eating if they're going to come home and sleep. To be Mishtatef B'Peruta, to include yourself in the host's lighting, is only applicable if a person is an Achsena'i, if they're a guest that they're staying, that's their residence. But if they're going to come home and sleep in their own home, then they cannot participate in the Hadlakat Nerot Hanukkah (lighting Hanukkah candles) of the person they're eating with. That would not satisfy or fulfill their obligation. So they have to make sure to time it out beforehand, to ensure that the candles go out and then they can leave the house to go to their friend.
If push comes to shove and they have a Goy (non-Jew), then they can ask the Goy to put it out because after the half hour, after the half hour, kamuvan (of course), they fulfill the obligation. Since extinguishing is a Melachah She'einah Tzrichah Legufah (labor not needed for its own sake), which is derabbanan (rabbinic), asking a Goy is also derabbanan. A Shevut (rabbinic restriction) is Shevut bimkom tzorech (in a time of need) if the person doesn't have food or has to go out. So that could be something a person relies on. We do it here in the Beit Knesset (synagogue) also, but a person should ideally not rely on that if he can think ahead of time, empty out the oil, and make sure it goes out a half hour after Tzet HaKochavim.