The Talmud (Shabbat 21b) prescribes lighting Chanukah candles at twilight, which was the ideal time for maximizing pirsumei nisa (publicizing the Chanukah miracle) in the pre-modern era. People returned home from work around sunset and were thus available to light their own candles or view those lit by others.
Nowadays, however – thanks to artificial light – most peoples’ workday or school day extends well beyond twilight during Chanukah (which, in the northern hemisphere, falls out in the winter when sunset is quite early). Must one leave work or school early to light Chanukah candles on time?
The Talmud states that the time frame for lighting Chanukah candles is between sunset and “when foot traffic ceases from the marketplace.” The Talmud notes that this “foot traffic” includes that of the tarmuda’ei, whom the Rishonim identify as sellers of firewood, who dallied in the market at the beginning of the night to be available to potential customers.
The Rif (Shabbat 9a) and Rambam (Hilchot Chanukah 4:5) define the time of “foot traffic ceases from the marketplace” as approximately half an hour after sunset. After that time, writes the Rambam, one has lost the opportunity to kindle that evening’s Chanukah candles. It thus appears that the Rambam would indeed require one to leave work or school early to light menorah.
The Ritva, however, argues that “foot traffic ceases from the marketplace” has no fixed definition. Rather, it depends on what time merchants who carry goods needed at night actually stop selling for the evening. That time may vary from era to era and place to place. (The Brisker Rav maintained that the Rambam held this position as well). Nowadays, stores base their closing times on the clock rather than a certain amount of time after sunset. Thus, in a pinch, the Ritva would allow lighting until quite late in most contemporary cities.
The most permissive opinion is that of the Rashba, who holds that post facto, one has the entire night to kindle the menorah.
Tosafot (s.v. “de’i”) points out an additional mitigating factor to allow lighting late. In the times of the Talmud, Chanukah candles were lit outside the front door in order to publicize the miracle to passersby. That is why Chazal connected the time for lighting to the presence of people in the marketplace. In later times, though, people began lighting menorah indoors to avoid antagonizing the non-Jewish populace. Since only those in the house could see the Chanukah candles anyway, the exact timing of kindling was no longer key.
Tosafot’s dispensation, of course, applies only to those who light inside. In most places nowadays, it is no longer dangerous to light menorah in the proper place – outside the doorway – and many people, especially in Israel, have returned to the ideal practice of lighting the candles outside. Those who do so must be careful to light the menorah before “foot traffic ceases from the marketplace.”
Besides being the latest time to light, the time of “foot traffic ceases” has additional significance. The Talmud suggests that even if one lights Chanukah candles at sunset, they must burn until “foot traffic ceases.” Since several Rishonim mention a fixed figure of 30 minutes, we should be careful to have the candles burn for that amount of time or until half an hour after nightfall, whichever is later (see Ner Yisrael by Rabbi M.M. Karp, chapter 4).
According to the Ritva, however, the candles have to burn until foot traffic ceases in one’s locale (at least if the menorah is visible to people in the street). In modern cities, that would mean making sure at least one of the Chanukah candles lasts several hours into the night. Although doing so is not the prevalent custom, many recent poskim believed it is quite reasonable to act in this manner (see Hilchot Chag BeChag Chanukah 6:9).
Regardless of when the latest time to light is, the Talmud states explicitly that the preferred time to kindle the menorah is mishetishka ha’chammah, when the sun sets. The simple understanding of this statement is that one should light the candles at halachic sunset, the beginning of twilight (bein ha’shemashot). Indeed, this is the opinion of most Rishonim. Some commentators, however, claim the Shulchan Aruch rules that the candles should actually be lit at halachic nightfall (the appearance of three stars, Magen Avraham, 672:1).
Even if we assume the correct time to light is at halachic sunset, we must determine exactly when that is. In general, contemporary practice equates halachic sunset with astronomical sunset, the disappearance of the orb of the sun below the horizon. But according to many poskim, halachic sunset is actually a bit later, when the sun’s bright rays disappear (see Or Me’ir by Rabbi Meir Posen, especially 2:5 regarding Chanukah).
Normally, using the astronomical definition of sunset results in a stringency, such as beginning Shabbat at an earlier time. On Chanukah, however, it would result in a leniency, so it is better to use a later definition of sunset to avoid lighting the menorah too early. For this reason, many great rabbis lit the menorah 10-20 minutes after astronomical sunset. Others, however, prefer to use the earlier sunset time even on Chanukah in order to fulfill the mitzvah during every moment it’s possible to do so (see Shvut Yitzchak on Chanukah, p. 71).
As a final note, it is often the case that one family member is at home at the ideal time for lighting while others are still at work or school. In such a situation, it is preferable for the person at home at sunset to light the candles on behalf of the entire household. Nevertheless, if the rest of the family will be upset, one could rely on the opinions that allow lighting later. In either case, of course, singing Maoz Tzur could be delayed until everyone comes home.
Summary: According to most authorities, the preferred time for lighting menorah is 10-20 minutes after astronomical sunset. If lighting at that time is difficult, lighting later in the evening is acceptable, especially if one is lighting inside.
If one lights the menorah in a place visible from the outside, one should take care to light within half an hour of halachic sunset, or at least before stores in one’s locale commonly close. Although the classical sources generally speak of the candles burning for half an hour, there is a pious practice to have at least one candle burning for as long as a significant number of people are out and about.