When may one extinguish the Chanukah candles?
Leaving home shortly after candle lighting, afraid that the unsupervised candles can lead G-d forbid to a fire? Many ask due to these reasons if they may extinguish the Chanukah candles after it has been lit for some time. This question is especially pertinent in Shul.
May one extinguish the flames once they have been lit for a half hour:
Once the flames have been lit for their minimum time, which is a half hour past nightfall, they may be extinguished. Initially, it is proper to stipulate that only a half hour’s worth of the oil is designated for the Mitzvah, if one intends to extinguish it after this time. [According to all, the Shamash may be extinguished after this time, even without stipulation.]
May the Menorah of a Shul be extinguished after it is lit, even prior to remaining lit for a half hour?
Some Poskim rule one may extinguish the candle upon everyone leaving the Shul, even prior to the passing of a half hour. Other Poskim however rule one is not to extinguish them until a half hour passes after nightfall. Practically, if there is worry of fire or the Menorah getting stolen, one may be lenient.
After a half hour: Once the Menorah has been lit for a half hour, it may be extinguished.
 Michaber 672:2; Rif and Rosh; Rashal 85
Other opinions: Some Poskim rule one is not to extinguish the candle even after the time has passed, being that all the oil was placed for the sake of the Mitzvah, and that so is the custom. [Bach and Tzeida Laderech, brought in M”A 672:4; 677:10; Peri Chadash 677; Shulchan Gavoa 672:9; Kaf Hachaim 672:21] Furthermore, some Poskim rule that those who light inside their home, must place enough oil to last until the people at home go to sleep, and one may not extinguish or make use of the candles until the time people go to sleep and the candles thus no longer serves as a publication. [Mishmeres Shalom 48:1; Piskeiy Teshuvos 672:4-5 footnote 24; see there footnote 16 and 23 for Melaktim who bring a similar opinion] Other Poskim rule that those who light outside their home are to place enough oil to last until people are no longer found outside, which is approximately 9:00, and one may not extinguish or make use of the candles until that time. [Teshuvos Vehanhagos 1:390; Moadim Uzmanim 2:141; 6:86; Piskeiy Teshuvos 672:5] Practically, this novelty is not recorded in the classical Poskim.
 The reason: As one only designates the amount of oil necessary to fulfill the Mitzvah, and hence the excess oil is not considered Holy. The candle may thus be extinguished and then relit for one’s personal use. [Beis Yosef 677; M”B 672:7]
 Mahariy brought in Beis Yosef 677; M”A 677:10; Elya Raba 672:2; Chayeh Adam; M”B 672:7; Kaf Hachaim 672:21
The reason: Some Poskim conclude that it is initially proper to stipulate that one does not have intent to designate the oil for more than the necessary amount of time, as there are Poskim [Mahariy brought in Beis Yosef] who rule that if did not make this stipulation, then the entire oil is designated for the Mitzvah and may hence not be extinguished. [Poskim ibid]
Other opinions: Some Poskim rule it is not necessary at all to make any stipulation when placing the oil, and it may be extinguished after a half hour in all cases. [Taz 672:1; first answer in Beis Yosef 677] The Elya Raba ibid negates this opinion of the Taz.
 Yosef Ometz 1076; Kinyan Torah 2:102; Shraga Hameir 3:16; Piskeiy Teshuvos 672:5
 Shraga Hameir 6/85
 The reason: As we do not find in any Poskim the need to light in Shul for a half hour, and since the main Takana is for the purpose of Pirsumei Nissa, therefore one may be lenient to extinguish the candles even within a half hour if there is no one left in Shul. [ibid]
 Sheivet Halevi 8/156
 The reason: It does not state anywhere in [earlier] Poskim that the Shul candles need to remain lit for a half hour. Furthermore, since the entire purpose of the lighting in Shul is Pirsumei Nissa, it is implied that it can be extinguished once the Pirsumei Nissa has ended. Nevertheless, we light it for a half hour due to Lo Pelug. [Milameid Lehoil ibid] Furthermore, the Menorah in the Temple was lit throughout the night and the Menorah in Shul is lit in commemoration of the Temple’s Menorah, accoridng to some opinions. Furthermore, accoridng to some opinions, one fulfills his obligation with the Shul’s lighting and hence it should follow the same laws as any other Menorah. [Sheveit Haleivi ibid]
 Sheivet Halevi ibid; Piskeiy Teshuvos 671/12
 Melameid Lehoil 121; See Zivcheiy Tzedek 2/29; See Michaber 672/2 regarding this ruling in the house Menorah.