It takes some time for a newborn's circadian system to develop, but by the time a baby is around five months old, they are able to sleep for extended periods of time throughout the night.