Until what time may Hamapil be recited-Saying Hamapil after midnight:
After midnight-before daybreak: It is permitted to recite the blessing of Hamapil after midnight, up until daybreak. However, some Poskim rule one may not recite the blessing after midnight. Practically, while the widespread custom is to say Hamapil with a blessing even after midnight, some are particular to say it without a blessing.
After daybreak-before sunrise: Once daybreak has arrived, one may no longer say the blessing, even if it is prior to sunrise. Nonetheless, one is to recite the paragraph without the concluding blessing. Once sunrise has arrived, the blessing is not to be recited at all.
The blessing of Hamapil may be recited anytime throughout the night, up until Alos Hashachar. However, some are accustomed to say it without a blessing from midnight and onwards.
If one is going to sleep prior to Alos, but is unsure if he will fall asleep before Alos, is Hamapil to be recited with a blessing?
In locations that have very few hours of nighttime, until when may Hamapil be recited?
Some write that in countries where the time of Alos is when people normally go to sleep, then one may say the blessing even past Alos, until sunrise.
 Birkeiy Yosef 239 in name of Lachmei Toda; Shaareiy Teshuvah 239:1; Biur Halacha 239:1 “Samuch”; Ashel Avraham Butchach 239; Kuntrus Alei Terufa; Darkei Chaim Veshalom 348; Keren Ledavid 60; Hisorerus Teshuvah 1:115; Meishiv Halacha 419; Binyan David 29; Teshuvos Vehanhagos 1:198; Piskeiy Teshuvos 239:2
 Birkeiy Yosef 239 in name of Lachmei Toda, brought in Shaareiy Teshuvah 239:1; Chesed Lealafdim 239:10; Rav Poalim 1 Sod Meisharim 14; Kaf Hachaim 239:8 based on Shaar Hakavanos; Custom of Jerusalem in Yeshivas Hamekubalim Beis Keil; Yechaveh Daas 4:21 that Safek Brachos Lihakel
 The reason: This is based on Kabala, as after midnight, it is no longer the tiem of sleep in the upper worlds. [Kaf Hachaim ibid]
 Biur Halacha ibid; Ashel Avraham Butchach 239; Keren Ledavid 60; Hisorerus Teshuvah 1:115; Meishiv Halacha 419; Binyan David 29;
The reason: As we compare the blessing of Hamapil to the blessing of Hashkiveinu, which may only be recited until Alos. [Biur Halacha ibid]
 Biur Halacha ibid
 Biur Halacha ibid; Meishiv Halacha 419; Binyan David 29; Piskeiy Teshuvos ibid
 Ashel Avraham Butchach 239
 Teshuvos Vehanhagos 1:198