If it’s going to orbit around the earth, what kind of orbit would it be (what distance)? Are there benefits to sending a telescope further away from the earth if it’s just to photograph galaxies and not objects that are in our solar system?
Your first question - is JWST going to orbit Earth - is a little complicated. It will follow a mission profile that will send it to the Sun-Earth $L_2$ Lagrangian point. It will take the telescope about three months to achieve its orbit in $L_2$. Now, $L_2$ is unstable, and so some station-keeping - essentially, course corrections by thrusters - will be needed. It won't be orbiting Earth, but orbiting the Sun with Earth, in a nearby location.
You're not quite right that JWST will only be observing objects outside the Solar System. Some of the most exciting targets - young, evolving galaxies and exoplanetary atmospheres - lie far beyond. However, the telescope's capabilities for atmospheric analysis (thank you, NIRSpec!), useful for determining the composition of exoplanetary atmospheres, will also be used for observations of the atmospheres of Mars and the giant planets, as well as compositional data for other bodies.
Now, it's not really helpful to send JWST elsewhere in the Solar System, given that most of its observations will be of objects outside the Solar System. Okay, maybe you could get higher-quality data on Mars if you sent it to Mars orbit, but that would be quite costly, and not effective for a spacecraft designed to be used by many scientists for a number of purposes. Keeping it at $L_2$ simplifies the orbital trajectories immensely, although it's still much too far away to repair, unlike Hubble. You also lessen the communication time.
Well, you might say, why not just launch JWST into Earth orbit? We have scientific instruments there; why do we go to the trouble of putting so many things at $L_2$? It turns out that debris high above Low Earth Orbit (LEO) would be too dangerous for the sensitive optics on the telescope. The best instruments are often also the most delicate, and JWST would be damaged if it was truly orbiting Earth, at LEO or elsewhere.
The James Webb Telescope will not be orbiting around the Earth, but the Sun, at a distance of 1.5 million kilometers or 1 million miles from the Earth. A benefit to sending it further away from the Earth is that there's less of the interference of light pollution from the Earth. The JWST's mirror is 21 feet wide, though, so its sensitivity to this will be miniscule, and its abilities unhindered. There are facts about it here and here.
It doesn't orbit us - it orbits the Sun, just like we do.
bizarrely and amazingly, it "stays with us" ...
it keeps position outside us - it takes JWT 365 days to go around, just as it takes us 365 days to go around.
How is this achieved?
We have an incredibly long piece of string attached to it.
We (the Earth) spin around just like on a playground ride. We hold on to the string, and the JWT goes around "outside" us, and stays in place.
Nah, no string but bizarrely gravity works exactly, precisely, like a string would - if you are at exactly the right distance.
Various interesting spacecraft hang out at this "L2" region. I have included an accurate drawing of our astounding GAIA spacecraft in the diagram.
The JWT is kind of the "strongman" of our space telescopes. The Tom Brady -quarterback type in high school. You know ... tallest, strongest, goes on to marry Giselle, etc. GAIA is kind of the "class smartass and superbrain" type. (Beyond all belief, GAIA is ... mapping the milky way. No, really.)
All of this was invented by the French (this guy called Lagrange - the "L" in "L2"), so today naturally the French just assume that JWT, etc, are all, basically, French things - after all, they thought of it, someone else just did some welding.
The actual "detailed" manner in which GAIA for example flies is a Lissajous orbit. (Yup - another French guy!) Coincidentally Lissajous sounds a bit like "lasso", and on nice diagrams such as here you can see it looks like a lasso. Giddyup, space telescopes!
NASA, err, France's blokes who worked this out:
Bonus factoid - you might be wondering why the effort to put it in this particular place. This was explained very nicely by @A.Leistra in a comment.
Have a careful look at the diagram and put yourself in the place of the yellow JWT... Try it at different points around the diagram.
Now - from any where on the circle, look towards the Earth and the Sun.
Notice that ......... they are in the same place from your point of view.
The Sun & Earth are total troublemakers to space telescopes. Because they are always in exactly the same direction, the JWT can keep its back to them at all times, always. The JWT has one big shield, which will always shield both the Sun & Earth.
How clever are the French?