As said already, your story is taken from Þrymskviða. There's a retelling of the story named The Children of Odin, which refers to that in a more easily comprehensible way:

The actual story does not say that Loki stole the hammer from Thor.

Then when they were far from Jötunheim Thor missed Miölnir, missed the hammer that was the defence of Asgard and the help of the Gods. He could not remember how or where he had mislaid it. Loki's thoughts went toward Thrym, that stupid Giant who yet had cunning streaks in him. Thor, who had lost the hammer that he had sworn never to let out of his sight, did not know what to do. But Loki thought it would be worth while to see if Thrym knew anything about it. He went first to Asgard. The Children of Odin

By having a discussion with Thrym, the hammer's location is identified:

"Ha, Loki, Shape-changer," said Thrym, "you are there! But all your watching will not help you to find Miölnir. I have buried Thor's hammer eight miles deep in the earth. Find it if you can. It is below the caves of the Dwarfs." The Children of Odin

During the feast, where Thor and Loki are disguised, the Hammer is presented to Thor .