The rule is, the batter is credited with as many bases as it takes to score the winning run. However, the scorer can award the batter as many bases at he gets in "the normal course of play", even if the winning run scores before he reaches the next base. So in other words, if there's a runner on 1B, and the batter hits a ball in the gap and the winning run scores from 1B, but the batter continues on to 3B and the ball is played just like it would be had it not been the winning run, the batter is awarded a triple, even if he didn't reach 3B before the winning run scores.