A Berit Mila must be performed during the day, and not at nighttime, and it must be performed on the infant’s eighth day, or later if it could not be done on that day.
What happens if a mistake was made, and the child was circumcised before his eighth day, or if he was circumcised after the eighth day, but at night?
This issue is subject to a three-way debate among the Halachic authorities.
The Rama (Rav Moshe Isserles of Cracow, 1530-1572), in Yoreh De’a, distinguishes between these two cases. He writes that if a child was circumcised after the eighth day, but at nighttime, the Berit is invalid, and he must therefore undergo "Hatafat Dam Berit" – meaning, some blood must be drawn from the area of the circumcision. If, however, the Berit was performed during the daytime, then the circumcision is valid even if it took place early, before the eighth day.
The Shach (Rav Shabtai Ha’kohen, 1621-1662) disagreed, and claimed that "Hatafat Dam Berit" is required in both cases. In his view, if a circumcision was performed at night or before the eighth day, some blood must be drawn in either case.
On the opposite end of the spectrum, the Bet Yosef (by Maran, Rav Yosef Karo, author of the Shulhan Aruch) ruled that in both cases, the circumcision is valid after the fact, and "Hatafat Dam Berit" is not needed. This is the ruling followed by Hacham Eliyahu Shama Ha’levi (Chief Rabbi of Aleppo, d. 1814), in his work Machshireh Mila (2:4; listen to audio recording for precise citation), and this is, indeed, the Halacha.
Summary: If a child was circumcised before his eighth day, or if he was circumcised after the eighth day but during the nighttime hours, the Berit is nevertheless valid, despite having been performed at the improper time, and no additional procedures are required.