Casting Debt of Loyalty puts a regeneration shield on a creature. If, later in the turn, that creature would be destroyed, instead it regenerates and you gain control of it. Note that it will be tapped when you gain control of it. The control change has no duration; you’ll retain control of that creature until the game ends or until some other effect causes it to change control.