Gaia orbits the second Lagrange Point (L2) in a Lissajous orbit. The James Webb Space Telescope orbits L2 in a halo orbit. The telescopes are between 400 000 and 1 100 000 km apart, depending on where they are in their respective orbits.
This image shows the relative sizes and locations of the Gaia orbit (yellow) and the Webb orbit (white). In this view Earth is located to the left, not far outside of the frame. Gaia’s Lissajous loops have L2 right in their centre, while Webb’s halo orbit loops are closer to Earth by about 100 000 km on average.