Basically, any ship capable of withstanding the stresses of Trek-style starflight should be able to land and take off; to fly under water; and to fly through solid rock.
It's a bit of a mystery why some of them are hesistant to do so. But the existence of inertia dampers, impulse engines, navigational deflectors and artificial gravity should guarantee all starships effortless operations within an atmosphere, or within bedrock for that matter.
However, perhaps there's something about this mighty gadgetry that we don't know yet. The Voyager was able to land easily enough, while not differing in any known manner from Kirk's ship. However, she was still subject to side winds and the like, even though a 700,000 ton lump of streamlined metal should have been pretty stable... So perhaps the same mass manipulation technologies that allow her to land make her vulnerable to atmospheric conditions?
Also, while Kirk's ship should have the ability to land on the tip of her nacelle and balance there for the next century or two, perhaps Starfleet doesn't want to do such things because they would lead to disaster if power were cut for some reason? Kirk's vessel wasn't built to be stable on ground, unless parked upside down. So clearly the designers didn't assume she would frequently land and depower (since depowering upside down would at the very least cause the people to fall down from the floors, and at worst might collapse the spindly engine pylons that may be holding up mainly on the strength of structural integrity forcefields).
Canonically, we know that Kirk's ship, Archer's earlier but identically sized starship, and Picard's much larger cityship were all perfectly capable of maneuvering in the lower atmosphere, even when damaged or with the crew incapacitated. It took special audacity to drive Picard's ship to the edge of her flight envelope in "Arsenal of Freedom", and still she outflew a much smaller and presumably more aerodynamic killer drone. The smaller starships have never been at significant risk even when deep down in the atmosphere of a gas giant, either.
Yet a landing and depowering would call for a certain shape of ship, preferably with landing pads, and most ships don't have that shape. That IMHO is sufficient proof that landing a starship, while an obvious theoretical possibility, is not a good idea in practice. Whether the reasons for that are technological or tactical is another question...
Timo Saloniemi