The JWST will be in orbit far from Earth, to avoid heat radiating from the Earth and moon.
This special orbit is beyond the moon, at the second Lagrange point (L2) of the Sun-Earth system, a place of stable gravity.
This orbit is 1,500,000 kilometres (930,000 miles) from Earth, about four times farther away from us than the moon.
 This keeps it in the Earth's shadow most of the time; it does not actually go around the Earth, but goes around the sun at the same speed as the Earth.
The JWST will be in orbit far from Earth, to avoid heat radiating from the Earth and moon. This special orbit is beyond the moon, at the second Lagrange point (L2) of the Sun-Earth system, a place of stable gravity. This orbit is 1,500,000 kilometres (930,000 miles) from Earth, about four times farther away from us than the moon.  This keeps it in the Earth's shadow most of the time; it does not actually go around the Earth, but goes around the sun at the same speed as the Earth.
James Webb Space Telescope