What does the Soul Stone actually do?
In Movies: We don't know the full capacity yet. As per Red Skull words:
"Soul holds a special place among the Infinity Stones. You might say, it is a certain wisdom."
"Tell me what it needs."
"To ensure that whoever possesses it understands its power, the stone demands a sacrifice."
Rest we only see him use it against Dr. Strange when he made his multiple duplicates and struck him in yellow rays:
He uses soul stone to find him and power stone to hit him. Rest we don't know much details of its power yet except the speculation which says that red world Thanos see young Gamora can be the soul stone pocket dimension.
In Comics: It's called soul gem and its power is:
Allows the user to steal, control, manipulate, and alter living and dead souls. The Soul Gem is also the gateway to an idyllic pocket universe. At full potential, the Soul Gem grants the user control over all life in the universe. Wikipedia
Conclusion: For now, we can assume it will work the same way and maybe the last Thanos scene is a hint to the pocket dimension of soul stone/gem.