סימן ע סעיף ב
לְכַתְּחִלָּה צָרִיךְ לְהִתְפַּלֵּל עַרְבִית מִיָּד בְּצֵאת הַכּוֹכָבִים. וְאָסוּר לְהַתְחִיל לֶאֱכֹל אוֹ לַעֲשׂוֹת שׁוּם דָּבָר, וַאֲפִלוּ לִלְמֹד, חֲצִי שָׁעָה קוֹדֵם צֵאת הַכּוֹכָבִים, כְּמוֹ סָמוּךְ לְמִנְחָה קְטַנָּה (וְעַיֵּן לְעֵיל סִימָן ס"ט סָעִיף ג'). וְאִם אֵין לוֹ פְּנַאי, כְּגוֹן שֶׁהוּא לוֹמֵד בָּרַבִּים, עַל כָּל פָּנִים לֹא יְאַחֵר יוֹתֵר מֵחֲצוֹת הַלַּיְלָה. וּבְדִיעֲבַד אֲפִלּוּ אַחַר חֲצוֹת עַד שֶׁלֹּא עָלָה עַמּוּד הַשַּׁחַר יָצָא (פ"ט רל"ב רל"ה).
It is preferable to pray Maariv immediately when the stars appear. It is forbidden to start a meal or do anything, even to study [Torah], one-half hour before the stars appear, the same as it is forbidden before Minchah ketanah.7See Chapter 69 para. 3. If you have no time, for instance, if you teach a group [at that time], you should, at least, not delay [praying Maariv] beyond midnight. Even if you prayed after midnight, although it is after the fact,8I.e., you had not prayed by midnight. as long as it is before daybreak, you have fulfilled your obligation.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)