According to the Iowa City High School Q/A with Joe Russo it is kind of an out of body experience. Russo goes into more detail on the scene and motivations behind what they were portraying.
[The next student’s audio did not come out clearly- from what I remember and from what I could understand- the student was asking why Gamorra appeared as a child towards the end of the film]
Russo: Yeah it’s- it’s implied it’s the soul stone. It’s all orange around, then he’s inside the soul stone with the amount of power that it took to snap his fingers- he has this out of body experience with Thanos. When he goes inside the Soul stone he has this kind of conversation with the younger version of his gamorra-
Student: So she’s there?
Russo: She’s in fact is yes.... It was an attempt an attempt on our part- because we don’t like two dimensional roles or three dimensional villains every villain is a hero in their own story and as insane and psychotic and brutal and violent as Thanos is he’s a more complex villain if you go on a journey with him emotionally. He does care for things and it is complicated for him to execute his plan and it cost him something. He said at the end “It cost him everything” and that it was the only thing he loved which was gamora which is why we put him back with her at the end. I just want to reiterate with the audience that he does feel true emotion even though he is a monster.
Iowa City High School Q/A, Pastebin
It’s worth noting though that Thanos does not seem to have been physically transported into the Soul Stone. Time may have stopped and he had the moments inside the Soul Stone with Gamora. Or he has the experience in the blink of an eye that others don’t see. It’s unclear.
However, it seems clear to me that Thanos never disappears physically and doesn’t escape Stormbreaker because of it. Thor’s reaction when we snap back to the main world seems to pretty much confirm this as he’s still in the same place with not much having changed for him: still holding Stormbreaker into Thanos’ chest, for example. He only escapes Stormbreaker because Thor doesn’t go for the head, then he Snaps and then he uses the Space Stone to transport away.
I think it’s also worth noting that Tony went to the Soul Stone in Avengers: Endgame and saw an older version of Morgan. However, this was cut from the final edit, the scene was still filmed though and can be viewed below: