The law of conservation of energy

What is the law of conservation of energy and how is this law applies to the Earth’s energy balance?  Generally, what happens to the energy from the sun (incoming solar radiation) once it passes into the Earth’s atmosphere?