The daytime sky on Earth is blue because the light from the Sun strikes molecules in the Earth's atmosphere and scatters in all directions. Blue light is scattered more than other colors, and reaches the eye in greater quantities, making the daytime sky look blue. This is known as Rayleigh scattering.
The nighttime sky seen from Earth is black because the part of Earth experiencing night is facing away from the Sun, the light of the Sun is blocked by the Earth, and there is no other bright nighttime source of light in the vicinity. So, there isn't enough light to cause Rayleigh scattering and make the sky blue.