Guest post by Rabbi Daniel Roselaar (with a brief comment at the end by me - Gil)
For many years I was always careful to eat the afikoman by chatzot [midnight, 1am with daylight savings] on Seder night, and if possible I regarded it as a hiddur [extra-meritorious practice] to drink the fourth of the cups by that time also. I believed that I was conducting a halachically optimal Seder and this also ensured that I didn’t fall asleep in shul on yomtov morning (which could have been embarrassing for a shul rabbi). But then my children started complaining that all the friends had much more exciting Sedarim and finished far later than we did. I thought it was super-frum to finish the Seder early but they felt as if they were the religious lightweights amongst all their friends. So I decided to reinvestigate the sugya [subject] in order to decide whether or not my stringencies were justified.
The Talmud (Pesachim 120b) records a Tannaitic dispute regarding the latest time for eating the Korban Pesach [Passover sacrifice]. According to R’ Elazar ben Azaria it must be consumed by (halachic) midnight whereas R’ Akiva maintains that it can be consumed until dawn. The Talmud also notes that though it is an independent mitzvah, there is an association between the Korban Pesach and matzah, and thus the timeframe that applies to the former also applies to the latter. Accordingly, R’ Elazar ben Azaria requires one to eat matzah by chatzot whereas R’ Akiva holds that it may be eaten any time until the morning.
Unsurprisingly, the Rishonim are divided about how to rule in practice. Tosafot (Megillah 21a) conclude that since there are several anonymous mishnayot that reflect the view of R’ Elazar ben Azaria, both the Korban Pesach and the matzah must be consumed by midnight. On the other hand, other Rishonim (including Baal HaIttur, Maggid Mishneh and probably the Rif) maintain that since there is a general rule that the halacha follows R’ Akiva when he is in dispute with another sage, these mitzvot can be fulfilled until daybreak. The Rosh and others cite both possibilities but conclude that because the mitzvot under consideration are Biblical requirements a strict approach should be followed.
Rambam (Korban Pesach 8:15) rules that midorayta [biblically] the halacha is in accordance with R’ Akiva, but the sages restricted the timeframe so that the Korabn Pesach be eaten by midnight, in order that one not err and mistakenly eat the sacrifice after daybreak (thereby not only missing the mitzvah but also incurring the punishment of karet). However, as far as matzah is concerned no such restriction was instituted and the mitzvah of matzah can be fulfilled any time up till daybreak (Chametz U’matzah 6:1).
The Shulchan Aruch (477:1) adopts a stringent view and rules that even the afikoman must be eaten by midnight. The Mishnah Berurah (Biur Halacha) advises that if one has not eaten the first kezayit [olive size] of matzah by this time one should still make sure to eat it (in case the halacha is in accordance with R’ Akiva) but that the brachah of “al achilat matzah” [blessing on the mitzvah of matzah] should not be recited (in case the halacha is in accordance with R’ Elazar ben Azaria).
The Shulchan Aruch also cites the view of the Ran that Hallel should also be recited before midnight. The Gra notes that this is in order that the fourth cup can be drunk before this time, and this view reflects the ruling of the Terumat Hadeshen (1:137) that the four cups reflect the four expressions of redemption which are in turn associated with the matzah as a symbol of freedom. Rav Soloveitchik further suggested that Hallel can be regarded as a part of the mitzvah of recounting the story of the Exodus and that mitzvah itself only applies when the mitzvot of matzah and marror are applicable (Siach HaGrid p. 31).
Clearly then, the ruling of the Shulchan Aruch indicates that one should be stringent. I did however come across various sources that mentioned that neither the Chatam Sofer nor the Netziv were strict in this regard. Furthermore, it occurred to me that the very inclusion of the story with the five rabbis in Bnei Brak, where they continued discussing Yetziat Mitzrayim until well after midnight, suggests that perhaps the author of the Haggadah cited it as a proof that the halacha is in accordance with R’ Akiva.
Perhaps I should have shared my findings with my children and taught them why I wish to finish the Seder early. But instead I reached a compromise. On the first evening we make sure to eat the afikoman by midnight, and if it looks like time is on our side we try to drink the fourth cup by that time also. On the second night (when the Seder usually commences rather later as well) we rely on the lenient opinions and only make sure that we fulfil motzi-matzah and marror by midnight and we try to continue discussing Yetziat Mitzrayim until we are overcome by tiredness.
 However, whilst the Korban Pesach may not be eaten after a certain time, the matzah may be eaten after this time. Regarding matzah the timeframe means that it must also be eaten before this time.
 Tosafot add that even the afikoman should be eaten by this time since that is the real matzat mitzvah.
 R’ Chayim Brisker noted a certain paradox in the Rambam’s ruling. Since the Rambam holds that the afikoman commemorates the Korban Pesach the afikoman must be eaten by midnight – as a function of Korban Pesach – even though the mitzvah of matzah could be fulfilled later. Accordingly, maybe one who delayed his Seder until after midnight could still fulfil the mitzvah of matzah (according to the Rambam) but should not eat the afikoman at the end of the meal!
 Some of us also employ the suggestion of the Avnei Nezer and eat a kezayit of matzah just before chatzot as well as afikoman at the end of the meal.
[I would just add that according to the Avnei Nezer, cited above in note 4, if your seder is running late you can do the following: Eat a kezayis (olive size) of matzah before midnight/1 am with an explicit condition that if the halakhah is that you have to eat afikoman before midnight, then this is the afikoman. But if the halakhah is that you can eat it all night, then this is not the afikoman and you will eat it later. Then you continue with your seder and eat a kezayis at the end which is either the afikoman (if the halakhah is that you can eat it all night) or not (if the halakhah is that you must eat it before midnight, in which case you already did). The Brisker Rav (quoted in Haggadah Shel Pesach Mi-Beis Ha-Levi, p. 210) said that you don't even need to make the explicit condition because either way, you eat the kezayis of matzah before midnight and then again at the end. If the later one kezayis no good then it does not undermine the earlier kezayis. - Gil]