It happens at the very end of the game, and which version you get depends on the ending you choose.
In one path you kill Darth Vader. In the other, the Emperor kills you instead — so whether Vader ends up your victim or your executioner comes down to the route you take.