מאי חנוכה דתנו רבנן בכ"ה בכסליו יומי דחנוכה תמניא אינון דלא למספד בהון ודלא להתענות בהון שכשנכנסו יוונים להיכל טמאו כל השמנים שבהיכל וכשגברה מלכות בית חשמונאי ונצחום בדקו ולא מצאו אלא פך אחד של שמן שהיה מונח בחותמו של כהן גדול ולא היה בו אלא להדליק יום אחד נעשה בו נס והדליקו ממנו שמונה ימים לשנה אחרת קבעום ועשאום ימים טובים בהלל והודאה
The Gemara asks: What is Hanukkah, and why are lights kindled on Hanukkah? The Gemara answers: The Sages taught in Megillat Ta’anit: On the twenty-fifth of Kislev, the days of Hanukkah are eight. One may not eulogize on them and one may not fast on them. What is the reason? When the Greeks entered the Sanctuary they defiled all the oils that were in the Sanctuary by touching them. And when the Hasmonean monarchy overcame them and emerged victorious over them, they searched and found only one cruse of oil that was placed with the seal of the High Priest, undisturbed by the Greeks. And there was sufficient oil there to light the candelabrum for only one day. A miracle occurred and they lit the candelabrum from it eight days. The next year the Sages instituted those days and made them holidays with recitation of hallel and special thanksgiving in prayer and blessings.
מתיב רב ששת (ויקרא כד, ג) מחוץ לפרוכת העדות יערוך וכי לאורה הוא צריך והלא כל ארבעים שנה שהלכו בני ישראל במדבר לא הלכו אלא לאורו אלא עדות היא לבאי עולם שהשכינה שורה בישראל
Rav Sheshet said: With regard to the Temple candelabrum, it is stated: “Outside the veil of the testimony, in the Tent of Meeting, shall Aaron order it from evening to morning before the Lord continually...(Leviticus 24:3). It must be understood: And does God require its light for illumination at night? Didn’t the children of Israel, all forty years that they walked in the wilderness, walk exclusively by His light, the pillar of fire? Rather, the lighting of the candelabrum is testimony to the whole world that the Divine Presence rests among Israel.
ת"ר נר חנוכה מצוה להניחה על פתח ביתו מבחוץ אם היה דר בעלייה מניחה בחלון הסמוכה לרה"ר ובשעת הסכנה מניחה על שלחנו ודיו
The Sages taught in a baraita: It is a mitzva to place the Hanukkah lamp at the entrance to one’s house on the outside, so that all can see it. If he lived upstairs, he places it at the window adjacent to the public domain. And in a time of danger, he places it on the table and that is sufficient to fulfill his obligation.
(א) צָרִיךְ לִזָּהֵר מְאֹד בְּהַדְלָקַת נֵרוֹת חֲנֻכָּה, וַאֲפִלּוּ עָנִי הַמִּתְפַּרְנֵס מִן הַצְּדָקָה שׁוֹאֵל אוֹ מוֹכֵר כְּסוּתוֹ וְלוֹקֵחַ שֶׁמֶן לְהַדְלִיק.
(1) One needs to be very diligent in kindling the Hanukkah lights. Even a poor man living off charity must lend or sell his clothes, and buy oil to kindle with.
אמר רב הונא הרגיל בנר הויין ליה בנים תלמידי חכמים
Rav Huna said: One who is accustomed to kindle lights on Shabbat and Hanukkah will be rewarded and have children who are Torah scholars, who will disseminate the light of Torah.
בנים תלמידי חכמים - דכתיב (משלי ו) כי נר מצוה ותורה אור על ידי נר מצוה דשבת וחנוכה בא אור דתורה:
Children who are Torah scholars: As the verse in Proverbs states, "The Commandment is a candle, and the Torah is a light, so through fulfilling the mitzvah of the candle of Hanukkah and Shabbat the light of Torah will come as well.
בני יששכר מאמרי חודש כסלו טבת/מאמר ב:ב
האור ההוא אשר ניתקן בימי מתתיהו בן יוחנן הוא הארה מן האור שנברא ביום הראשון אשר האור הנסיי בימים ההם בזמן הזה היה אור ניסיי והאיר מן הארת אור הגנוז וכן הוא למשמרת בכל שנה ושנה, והנה האור הגנוז נגנז בתורה כמו שכתבתי כמה פעמים מפי קדמונינו ז"ל, ועל כן האור ונר מצוה רומזים לתורה... והנה רצו היונים לבטל את התורה אור, ועל כן נעשה הנס בשמן רמז לחכמה... ונעשה הנס במנורה ג"כ רמז לחכמה.
Bnei Yissaschar: Teachings About Kislev/Tevet, Teaching 2
The light which was established under Mattathias was an illumination of the light which was created on the first day of creation, a miraculous light in those days which continues into ours as an emanation of the premordial light stashed away after creation but illuminated every year at this time. This hidden light was stashed in the Torah, which is why as both light and candles are references to the Torah. The Greeks wanted to nullify the light of the Torah, and therefore the miracle of this holiday was done through oil, which is a reference to wisdom, and through a menorah, which is also a reference to wisdom.
דאי לא אדליק מדליק - אבל מכאן ואילך עבר הזמן אומר הר"י פורת דיש ליזהר ולהדליק בלילה מיד שלא יאחר יותר מדאי ומ"מ אם איחר ידליק מספק ... ולר"י נראה דעתה אין לחוש מתי ידליק דאנו אין לנו היכרא אלא לבני הבית שהרי מדליקין מבפנים:
If one did not light at sunset, he/she may light candles until traffic ceases from the marketplace: But from that point onwards, the time has passed, and you therefore need to be careful to light as soon as it turns to night so that you don't wait too long. However if you are later than this you should still light, as it appears to the Ri that it doesn't matter what time you light since we are only lighting for the people in the house, and we leave our lights inside.
(ה) אֵין מַדְלִיקִין נֵרוֹת חֲנֻכָּה קֹדֶם שֶׁתִּשְׁקַע הַחַמָּה אֶלָּא עִם שְׁקִיעָתָהּ לֹא מְאַחֲרִין וְלֹא מַקְדִּימִין. שָׁכַח אוֹ הֵזִיד וְלֹא הִדְלִיק עִם שְׁקִיעַת הַחַמָּה מַדְלִיק וְהוֹלֵךְ עַד שֶׁתִּכְלֶה רֶגֶל מִן הַשּׁוּק. וְכַמָּה הוּא זְמַן זֶה כְּמוֹ חֲצִי שָׁעָה אוֹ יֶתֶר. עָבַר זְמַן זֶה אֵינוֹ מַדְלִיק. וְצָרִיךְ שֶׁיִּתֵּן שֶׁמֶן בַּנֵּר כְּדֵי שֶׁתִּהְיֶה דּוֹלֶקֶת וְהוֹלֶכֶת עַד שֶׁתִּכְלֶה רֶגֶל מִן הַשּׁוּק. הִדְלִיקָהּ וְכָבְתָה אֵינוֹ זָקוּק לְהַדְלִיקָהּ פַּעַם אַחֶרֶת. נִשְׁאֲרָה דּוֹלֶקֶת אַחַר שֶׁכָּלְתָה רֶגֶל מִן הַשּׁוּק אִם רָצָה לְכַבּוֹתָהּ אוֹ לְסַלְּקָהּ עוֹשֶׂה:
(5) One may not light Chanukah candles before the sun sets, but rather [light] with its setting - not after, and not before. [If] he forgot or intentionally did not light with the setting of the sun, he can light until pedestrians leave the marketplace. And how long is this time? Like a half hour or more. If this time passes, he [may] not light. And he needs to put enough oil in the candle so that it will continue to be lit until the pedestrians leave the marketplace. If he lit it and it became extinguished it, he is not required to light it another time. If it stayed lit after the pedestrians leave the marketplace, he can extinguish it or take it away, if he wants.
עַל הַנִּסִּים וְעַל הַפֻּרְקָן וְעַל הַגְּבוּרות וְעַל הַתְּשׁוּעות וְעַל הַמִּלְחָמות שֶׁעָשיתָ לַאֲבותֵינוּ בַּיָּמִים הָהֵם בִּזְּמַן הַזֶּה:
() לחנוכה: בִּימֵי מַתִּתְיָהוּ בֶּן יוחָנָן כּהֵן גָּדול חַשְׁמונַאִי וּבָנָיו. כְּשֶׁעָמְדָה מַלְכוּת יָוָן הָרְשָׁעָה עַל עַמְּךָ יִשרָאֵל לְהַשְׁכִּיחָם תּורָתֶךָ וּלְהַעֲבִירָם מֵחֻקֵּי רְצונֶךָ: וְאַתָּה בְּרַחֲמֶיךָ הָרַבִּים עָמַדְתָּ לָהֶם בְּעֵת צָרָתָם. רַבְתָּ אֶת רִיבָם. דַנְתָּ אֶת דִּינָם. נָקַמְתָּ אֶת נִקְמָתָם. מָסַרְתָּ גִבּורִים בְּיַד חַלָּשִׁים. וְרַבִּים בְּיַד מְעַטִּים. וּטְמֵאִים בְּיַד טְהורִים. וּרְשָׁעִים בְּיַד צַדִּיקִים. וְזֵדִים בְּיַד עוסְקֵי תורָתֶךָ. וּלְךָ עָשיתָ שֵׁם גָּדול וְקָדושׁ בְּעולָמֶךָ. וּלְעַמְּךָ יִשרָאֵל עָשיתָ תְּשׁוּעָה גְדולָה וּפֻרְקָן כְּהַיּום הַזֶּה: וְאַחַר כֵּן בָּאוּ בָנֶיךָ לִדְבִיר בֵּיתֶךָ. וּפִנּוּ אֶת הֵיכָלֶךָ. וְטִהֲרוּ אֶת מִקְדָּשֶׁךָ. וְהִדְלִיקוּ נֵרות בְּחַצְרות קָדְשֶׁךָ. וְקָבְעוּ שְׁמונַת יְמֵי חֲנֻכָּה אֵלּוּ. לְהודות וּלְהַלֵּל לְשִׁמְךָ הַגָּדול:
"We thank You also for the miraculous deeds and for the redemption and for the mighty deeds and the saving acts wrought by You, as well as for the wars which You waged for our ancestors in ancient days at this season. In the days of the Hasmonean Mattathias, son of Johanan the high priest, and his sons, when the iniquitous Greco-Syrian kingdom rose up against Your people Israel, to make them forget Your Torah and to turn them away from the ordinances of Your will, then You in your abundant mercy rose up for them in the time of their trouble, pled their cause, executed judgment, avenged their wrong, and delivered the strong into the hands of the weak, the many into the hands of few, the impure into the hands of the pure, the wicked into the hands of the righteous, and insolent ones into the hands of those occupied with Your Torah. Both unto Yourself did you make a great and holy name in Your world, and unto Your people did You achieve a great deliverance and redemption. Whereupon your children entered the sanctuary of Your house, cleansed Your temple, purified Your sanctuary, kindled lights in Your holy courts, and appointed these eight days of Hanukkah in order to give thanks and praises unto Your holy name."