In addition to Mark's great answer ...
Why are we building larger land-based telescopes instead of launching larger ones into space?
If you had money for two homes, one near work and a 'summer cottage' in the woods, how would you divide your budget?
This question is a follow-up to Do bigger telescopes equal better results?
Yes, and I'm not a fan of those answers, perhaps @MarkOlson is also not impressed.
Those answers miss adaptive optics (dismissing it as expensive and not particularly effective) and the ability to easily upgrade everything except the size of the building and main mirror.
How much bigger does a ground-based mirror have to be to match what a space-based one can do? I guess I'm asking primarily for visible light, but I'm interested in general too.
It's not so much "how much bigger", it's "effectively market your idea, secure as much funding as possible, and build the largest building with the biggest main mirror possible". Dig deep and build what you can, not be upgraded as big as you can - sensors and supercomputers can fix the rest.
I guess on the ground, you're safe from micrometeorites, so it will probably last longer. At what point does it become cheaper to build a telescope on the moon or something?
Ground and space-based telescopes are useful, moon-based less so.
When we have "The Acme Telescope Company" open their first store on the moon the price to purchase will fall, until then Earth and space-based will be cheaper. With space-based it can meet you halfway for repairs, with ground based (even on the top of a mountain) a repair facility is often close at hand.
At Paranal the mirror maintenance building is located on the mountain top, near the mirrors.
The Scientific America article: Is the James Webb Space Telescope "Too Big to Fail?" explains:
“Assuming we make it to the injection trajectory to Earth-Sun L2, of course the next most risky thing is deploying the telescope. And unlike Hubble we can’t go out and fix it. Not even a robot can go out and fix it. So we’re taking a great risk, but for great reward,” Grunsfeld says.
There are, however, modest efforts being made to make JWST “serviceable” like Hubble, according to Scott Willoughby, JWST’s program manager at Northrop Grumman Aerospace Systems in Redondo Beach, California. The aerospace firm is NASA’s prime contractor to develop and integrate JWST, and has been tasked with provisioning for a “launch vehicle interface ring” on the telescope that could be “grasped by something,” whether astronaut or remotely operated robot, Willoughby says. If a spacecraft were sent out to L2 to dock with JWST, it could then attempt repairs—or, if the observatory is well-functioning, simply top off its fuel tank to extend its life. But presently no money is budgeted for such heroics. In the event that JWST suffers what those in spaceflight understatedly call a “bad day,” whether due to rocket mishap or deployment glitch or something unforeseen, Grunsfeld says there’s presently an ensemble of in-space observatories, including Hubble, and an ever-expanding collection of powerful ground-based telescopes that would offset such misfortune.

Launch Vehicle Interface Ring (LVIR) Forgings (2) delivered
Quote from the "James Webb Space Telescope" (JWST) website:
The completed primary mirror will be over 2.5 times larger than the diameter of the Hubble Space Telescope's primary mirror, which is 2.4 meters in diameter, but will weigh roughly half as much.
The James Webb Space Telescope will collect light approximately 9 times faster than the Hubble Space Telescope when one takes into account the details of the relative mirror sizes, shapes, and features in each design," said Eric Smith, JWST program scientist at NASA Headquarters, Washington. The increased sensitivity will allow scientists to see back to when the first galaxies formed just after the Big Bang. The larger telescope will have advantages for all aspects of astronomy and will revolutionize studies of how stars and planetary systems form and evolve.
See also: "Webb vs Hubble Telescope":
... more distant objects are more highly redshifted, and their light is pushed from the UV and optical into the near-infrared. Thus observations of these distant objects (like the first galaxies formed in the Universe, for example) requires an infrared telescope.
This is the other reason that Webb is not a replacement for Hubble is that its capabilities are not identical. Webb will primarily look at the Universe in the infrared, while Hubble studies it primarily at optical and ultraviolet wavelengths (though it has some infrared capability). Webb also has a much bigger mirror than Hubble. This larger light collecting area means that Webb can peer farther back into time than Hubble is capable of doing. Hubble is in a very close orbit around the earth, while Webb will be 1.5 million kilometers (km) away at the second Lagrange (L2) point.
...
How far will Webb see?
Because of the time it takes light to travel, the further away an object is, the further back in time we are looking.

This illustration compares various telescopes and how far back they are able to see. Essentially, Hubble [HST] can see the equivalent of "toddler galaxies" and Webb Telescope [JWST] will be able see "baby galaxies". One reason Webb will be able to see the first galaxies is because it is an infrared telescope. The universe (and thus the galaxies in it) is expanding. When we talk about the most distant objects, Einstein’s General Relatively actually comes into play. It tells us that the expansion of the universe means it is the space between objects that actually stretches, causing objects (galaxies) to move away from each other. Furthermore, any light in that space will also stretch, shifting that light's wavelength to longer wavelengths. This can make distant objects very dim (or invisible) at visible wavelengths of light, because that light reaches us as infrared light. Infrared telescopes, like Webb, are ideal for observing these early galaxies.
Updates in adaptive optical techniques are ongoing, see: "Fast Coherent Differential Imaging on Ground-Based Telescopes using the Self-Coherent Camera" (7 Jun 2018), by Benjamin L. Gerard, Christian Marois, and Raphaël Galicher:
"We develop the framework for one such method based on the self-coherent camera (SCC) to be applied to ground-based telescopes, called Fast Atmospheric SCC Technique (FAST). We show that with the use of a specially designed coronagraph and coherent differential imaging algorithm, recording images every few milliseconds allows for a subtraction of atmospheric and static speckles while maintaining a close to unity algorithmic exoplanet throughput. Detailed simulations reach a contrast close to the photon noise limit after 30 seconds for a 1 % bandpass in H band on both 0th and 5th magnitude stars. For the 5th magnitude case, this is about 110 times better in raw contrast than what is currently achieved from ExAO instruments if we extrapolate for an hour of observing time, illustrating that sensitivity improvement from this method could play an essential role in the future detection and characterization of lower mass exoplanets."
In short, sometimes they can completely remove the atmosphere. Improvements are coming.
ESO 4LGSF - Laser Guide Stars Facility - Four lasers are used to create guide stars for the AO.