The Space Gem allows it's user to manipulate space in a nearly limitless manner when used properly. With limited knowledge, a user can teleport to any place in the universe with but a thought. Any persons or objects touched by the user can be moved as well. The gem can also change distance between objects in space, making the user appear to have super speed. The gem can also be used to pinpoint the location of a person or place.
With great knowledge of the gem (or in unison with the other Infinity Gems), the Space Gem can allow it's user to be omnipresent - simultaneously in every place in the universe.
Originally called the Soul Gems, the Infinity Gems were gathered by the Elders of the Universe to destroy Galactus. After their defeat, the Space Gem remained in the possession of the Runner, who did not know the gems purpose but was able to use it to travel faster than he ever could before (he was really warping distance in space, not traveling faster). The gem was taken from him by Thanos, who gathered all the gems to unite them in the Infinity Gauntlet.
Adam Warlock next possessed the Gauntlet, but gave the gems to individuals of his choosing for safe keeping. He chose Pip the Troll to guard the Space Gem as he had a natural ability (cowardice) to teleport from danger (and thus remove the gem from harm).Even after the gem was removed from his keeping, Pip retained the teleportation abilities bestowed by the gem, an obvious side effect of possession (although this may only be for long-term possession).
After the Infinity Wars event where Gamora attempted to combine the Infinity Gems, Adam Warlock used the Soul Gem to imbue all the gems with a sense of purpose. This way, they can choose their own destinies rather than became the pawn of another user. The Space Gem chose Quantum.
Wielders of the Power Gem
The space stone is first seen in the post-credits scene of Thor as the Tesseract. It was in the possession of Nick Fury, who asked Dr. Selvig to research it.
Captain America: First Avenger
The Tesseract was found by the Red Skull, who used it to develop new weapons for his Nazi splinter cell, Hydra. It became Captain America's mission to stop the Red Skull and retrieve the Tesseract. However, when Red Skull tried to tap directly into its powers, Red Skull was teleported to an unknown location and the Tesseract fell into the ocean.
Howard Stark would find the Tesseract while searching for Captain America's body and keep it in SHIELD's possession until the events of The Avengers.
Loki was sent to Earth by Thanos using the teleportation abilities of the Tesseract. He stole the cube from SHIELD's possession and used it to open a portal above New York City letting in the Chitauri army. Once he was defeated, the Tesseract was sent to Asgard with Thor, where he kept it in Odin's vault.
While retrieving the crown of Surtur to help Thor against Hela, Loki takes a long look at the Tesseract. It is revealed later that he stole it at this time saving it from the destruction of Asgard.
Avengers Infinity War
Thanos tracked the Tesseract to the spaceship carrying surviving Asgardians and the Warbound. Thanos tortured and killed Asgardians until Loki gave up the Tesseract. Thanos smashed the cube and combined the Space Stone with the other Infinity Stones to wipe out 50% of life in the universe.
In the movie Captain Marvel, taking place in the 1990s, the Tesseract is being used by Captain Mar-Vell, in human disguise as a SHIELD employee, to create a faster-than-light space ship to save Skrull refugees. When the engine was attacked, the Tesseract let out an energy pulse that gave Carol Danvers her powers.
The Kree became interested in the Tesseract for its role in giving Danvers superpowers, but when they are revealed to be the real fascists, Danvers turns against the Kree. To hide it from the Kree, the Tesseract was swallowed by the Flerken, Goose, who later spit it up in Fury's office, thus keeping it in SHIELD's custody.
Thanos uses the combined power of the stones to destroy them so that his work couldn't be undone.
After Tony Stark perfects time travel, the surviving Avengers steal the stones from earlier in the timeline. Iron Man and Ant-Man are sent to the Battle of New York to steal the Space Stone from the Avengers once the battle finishes. Unfortunately, the Tesseract gets within Loki's reach, who uses it to escape. This forces Captain America and Tony Stark to make a second unplanned trip further into the timeline to steal the Tesseract from a SHIELD facility run by Howard Stark.
Stark brings it to the present, where Hulk uses the combined powers to bring back the 50% of life Thanos wiped away. Later, it is used by Tony Stark, who had to wrestle the stones away from Thanos to wipe out Thanos and his army.
Captain America returns the stone exactly where it was found in the timeline.
The Loki streaming series picks up where we last see Loki in Avengers: Endgame. After using the Tesseract to escape, he is taken into custody by the Time Variance Authority. Thanks to the time travel interruption by the Avengers, Loki was able to leave his predestined timeline thus becoming a variant. While in custody, Loki continued to pine for the power of the Tesseract until he found it stored with other variant infinity stones that were discarded by the TVA.