The Shulchan Aruch · Orach Chayim
אורח חיים תרע״בOrach Chayim 672
Siman 672 of 697 in Orach Chayim — 2 se'ifim
הלכות חנוכהLaws of Chanukah· siman 672
Se’if 1א׳
אֵין מַדְלִיקִין נֵר חֲנֻכָּה קֹדֶם שֶׁתִּשְׁקַע הַחַמָּה, אֶלָּא עִם סוֹף שְׁקִיעָתָהּ, לֹא מְאַחֲרִים וְלֹא מַקְדִּימִים. וְיֵשׁ מִי שֶׁאוֹמֵר שֶׁאִם הוּא טָרוּד יָכוֹל לְהַדְלִיק מִפְּלַג הַמִּנְחָה וּלְמַעְלָה, וּבִלְבַד שֶׁיִּתֵּן בָּהּ שֶׁמֶן עַד שֶׁתִּכְלֶה רֶגֶל מִן הַשּׁוּק.
Chanukah candles are not lit before sunset, but rather with the end of sunset, neither later nor before. And there are those who say that if one is busy, it is permissible to light from Plag Hamincha and onward, as long one puts enough oil [so that the lamp will remain lit] until people stop passing through the marketplace.
Se’if 2ב׳
שָׁכַח אוֹ הֵזִיד וְלֹא הִדְלִיק עִם שְׁקִיעַת הַחַמָּה, מַדְלִיק וְהוֹלֵךְ עַד שֶׁתִּכְלֶה רֶגֶל מִן הַשּׁוּק, שֶׁהוּא כְּמוֹ חֲצִי שָׁעָה שֶׁאָז הָעָם עוֹבְרִים וְשָׁבִים וְאִכָּא פִּרְסוּמֵי נִסָא; הִלְכָּךְ צָרִיךְ לִתֵּן בָּהּ שֶׁמֶן כְּזֶה הַשִּׁעוּר, וְאִם נָתַן בָּהּ יוֹתֵר יָכוֹל לְכַבּוֹתָהּ לְאַחַר שֶׁעָבַר זֶה הַזְּמַן, וְכֵן יָכוֹל לְהִשְׁתַּמֵּשׁ לְאוֹרָהּ לְאַחַר זֶה הַזְּמַן. הַגָּה: יֵשׁ אוֹמְרִים שֶׁבַּזְּמַן הַזֶּה שֶׁמַּדְלִיקִין בִּפְנִים אֵינוֹ צָרִיךְ לִזָּהֵר לְהַדְלִיק קֹדֶם שֶׁתִּכְלֶה רֶגֶל מִן הַשּׁוּק (דִּבְרֵי עַצְמוֹ וְטוּר בְּשֵׁם תּוֹסָפוֹת), וּמִכָּל מָקוֹם טוֹב לִזָּהֵר גַּם בַּזְּמַן הַזֶּה; וּמִיהוּ הָנֵי מִלֵּי לְכַתְּחִלָּה, אֲבָל אִם עָבַר זֶה הַזְּמַן וְלֹא הִדְלִיק, מַדְלִיק וְהוֹלֵךְ כָּל הַלַּיְלָה; וְאִם עָבַר כָּל הַלַּיְלָה וְלֹא הִדְלִיק, אֵין לוֹ תַּשְׁלוּמִין. הַגָּה: וּבַלֵּילוֹת הָאֲחֵרוֹת יַדְלִיק כְּמוֹ שְׁאָר בְּנֵי אָדָם, אַף עַל פִּי שֶׁלֹּא הִדְלִיק בָּרִאשׁוֹנָה (מָצָא כָּתוּב בְּשֵׁם מַהֲרִי"ל וַאֲגֻדָּה וְדִבְרֵי עַצְמוֹ).
If one did not light with sunset, either due to forgetfulness or on purpose, he should go ahead and light until people stop passing through the marketplace, which is approximately half an hour, because then the people are passing and coming home and thus the miracle is publicized. Therefore one must place enough oil for that time, and if one put more oil in, he may extinguish the candle after that time has passed, and may use the light after that time. Re"ma: There are those who say that in this time, when people light indoors, there is no need to be careful to light before people stop passing through the marketplace (these are his own words, and the words of the Tur, quoting Tosafot), and regardless, it is good to be careful even now. And this is the ideal case. But it this time has passed and s/he has not lit, go ahead an light all night, and if the entire night has passed and s/he has not lit, there is no making up for it later. Rema: And on other nights, one should light like all other people, even though s/he did not light at first. [He found this written in the name of the Maha"ril and also shared it as his own opinion.]
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0