Mjolnir, the mystical short-handled Uru-metal warhammer of the Asgardian, Thor Odinson, has two enchantments related to movement. Both can and have been subverted over Thor's history in the Marvel universe, but they are the most consistent powers of Mjolnir.
The first enchantment allows, when Mjolnir is deliberately thrown by Thor, to return to his hand after striking or attempting to strike a target despite any intervening obstacles or distance, even traveling through planets to return to Thor.
It has been blocked from returning by placing objects or substances between Thor and the hammer. Captain America using his shield and Magneto (using his magnetic powers) were known to have deflected the hammer from returning to Thor, even temporarily.
The hammer's movement limitation can be subverted if one picks up Thor and throws him, or punches him hard enough. We have even seen Mjolnir being "wielded" like a club against Thor in zero gravity by the Red Hulk, partially because Thor was still in contact with it and partially because of the zero G environment.
Thor taking a beating with Mjolnir at the hands of the Red Hulk due to a technicality...
Editor Tom Brevoort has offered the official explanation of how a bad guy like the Red Hulk could wield Mjolnir.
"…during a pause at one of our editorial retreats a few years ago, Jeph Loeb asked me if there were any circumstances under which the Red Hulk might be able to lift Thor’s hammer. We batted it around for awhile, and after some thought I told him that I could foresee two circumstances under which that might work: 1) If Thor still had his hand within the hammer’s thong or in his hand as well, so that the worthiness enchantment was defeated in that [Thor] himself [was] still in contact with the weapon, and 2) if the battle occurred in space where there was no gravity, and therefore the hammer was weightless. Jeph ended up using versions of both of these approaches in the story he thereafter wrote."
- When Mjolnir is dropped or set aside, it takes a fixed position, from which it cannot be moved except by a 'worthy' individual. This power does not stop the hammer from being driven from place to place in a vehicle unless Thor does not want it to be moved. If it is dropped by Thor in a battle, its "default" setting is immovable until summoned by Thor. So while on the Helicarrier, Mjolnir could sit on a shelf somewhere until Thor called for it and it would still be immovable to a person trying to drag it away, but perfectly able to be flown where it needs to be.
This immovability enchantment has been subverted as well. Mjolnir has been wielded by a select number of other individuals: alien Beta Ray Bill; Avenger Captain America; Eric Masterson; Odin (Thor's father); Borr (Thor's grandfather); and Buri (also known as Tiwaz, Thor's great-grandfather).
The hammer has also been lifted by various sentient constructs (non-sentient machines apparently cannot), such as Zarrko the Tomorrow Man's mining robot; the Air-Walker (animated by the soul of Nova Corps captain Gabriel Lan); and the Awesome Android (by mimicking Thor's abilities and worthy nature). The hammer has also been lifted by Earth itself when animated via magical means. --Wikipedia -> Mjolnir (comics)
Captain America (in his guise as The Captain) wields Mjolnir long enough to free himself and return the hammer to Thor (off panel).