Novelization by Alan Dean Foster clarifies what happened.
They didn't exit hyperspeed/hyperspace on the surface of the planet.
They approached the planet at lightspeed to be able to get through the planetary shields (which aren't right on the surface), THEN slowed down.
“No planetary defense system can be sustained at a constant rate. It would take too much power. Besides, it isn’t necessary. All planetary shields have a fractional refresh. Instead of being constantly ‘on,’ they fluctuate at a predetermined rate. Keeps anything traveling less than lightspeed from getting through. Theoretically, a ship could get its nose in when a shield is off. Half a second later, the shield snaps back on and—well, it isn’t good for anyone on that ship.”
“Okay, I get that,” Finn told him. “Which brings me back to my first question: How are we getting in? Without being cut in half by an oscillating shield?”
“Easy.” The way Han said the word made it sound like the simplest thing in the world. “We won’t be going slower than lightspeed.”
Unsure he’d heard correctly, Finn gaped at him. “We’re gonna make our landing approach at lightspeed? Nobody’s ever done that! At least, I’ve never heard of anybody ever doing it.” ...
Han smiled pleasantly. “We’re coming up on the system. I’d sit down, if I were you. Chewie, get ready.”
As the wide-eyed Finn scrambled for a seat and harness and found himself wishing for a number of very large, soft pads, Chewbacca groaned his readiness. Han studied the readouts before him. The Wookiee raised a hand over his own console.
“And…” Han followed the declining fractions intently. “Now!”
Human and Wookiee hands flew over the main console, supplementing as best they could the approach and landing information they had preprogrammed into the Falcon’s instrumentation. Not unexpectedly, more than one last-second override was required in order to make the ship do something that was against its nature and perform maneuvers for which it had never been designed.
And just like that, they were inside the shields.
At that point they were traveling at very much sublightspeed, continuing to slow at an incredible rate, and heading above snow-covered ground directly for a forest that was not as tall but was far denser than the one on D’Qar. Chewbacca howled loudly enough for Finn to hear him clearly above the wild, blaring alarms.
Now, confusingly, it doesn't say that they dropped out of hyperspace at any specific point here, BUT, we can be pretty sure that they did, because eventually they maneuvered. You don't maneuver in Hyperspace.
This tells us that they exited hyperspace somewhere outside the planet once they bypassed its shield (and presumably, still outside gravity well), then continued on to fly in sub-lightspeed towards the surface.
However, this happened so fast, you wouldn't notice the difference visually in the film. Sub-second transitions.