It took approximately 400,000 years after the Big Bang for the universe to cool down enough to allow the formation of atoms.