Over the first 3 months, the baby gradually sleeps for longer periods. By the third or fourth month, most babies sleep for their longest period (up to 7 to 8 hours) during the night and develop set nap times. You can help your baby-and yourself-sleep better. When your baby is getting sleepy, put your baby in his or her crib in a quiet, darkened room. 2  This will help your baby learn to go to sleep in his or her crib. 3  Don't rock your baby to sleep after about age 4 to 6 months. 4  Rock your baby, but lay the baby down to sleep while he or she is drowsy but still awake.