Mjolnir doesn't actually "stick" to anything, at least not in the sense you seem to be implying.
What happens is, once Thor has let go of the hammer, no one else can move it from that spot, because they would effectively be "wielding" it. When not being carried by a person, the hammer behaves much like any other object in terms of obeying the law of gravity. (That excludes, for obvious reasons, those times when Thor is actively pulling the hammer towards himself.)
For example, if Thor pressed the hammer against a wall and let it go, it would drop to the floor. If that floor happened to be, say, on the helicarrier, the plane could still change altitude, and the hammer would stay on the floor as it went up and down. This concept is very briefly, albeit jokingly, mentioned at the end of Age of Ultron -- if the hammer were in an elevator, the elevator could move up and down with the hammer inside it.
However, if Thor were to place the hammer on top of a person, pinning them to the ground, that person could not push the hammer off of them. They couldn't do anything that would require the hammer to move at all. They could probably drag themselves out from under if, as long as the hammer itself remained stationary. If they did so, the hammer would just fall to the ground.
Note, however, that Mjolnir is also a war hammer, and thus is naturally very heavy. It's not clear just how heavy it is, since Thor's ability to lift it is magically enhanced, but according to one prominent physicist:
If you were to put it on a shelf, it would have a sizable amount of inertia keeping it in place, like any heavy object. If it were on a boat or plane that could tilt dramatically enough, it might slide off, but we've never really seen it sitting around anywhere for very long to know what that threshold is.
In another answer you bring up the idea of Mjolnir in space. In fact, there have been cases where people were able to move Mjolnir around in space, but once the hammer came close to Earth, gravity took over.
See this question:
Can Thor's hammer be wielded by anyone in outer space?
However, I suspect those rules don't apply in the MCU. Those examples largely rely on the idea that Mjolnir is "too heavy" to wield on Earth; in the MCU, that's not precisely the case: it's impossible for anyone, no matter how strong, to "wield" it if they're unworthy. This has obviously never happened in the MCU, so we just don't know.