According to the Law 16...
16.6.1 As soon as a result is reached as defined in 16.1, 16.2, 16.3, 16.4 or 16.5.1, the match is at an end. Nothing that happens thereafter, except as in Law 41.18.2 (Penalty runs), shall be regarded as part of it. Note also 16.9.
16.6.3 If a boundary is scored before the batsmen have completed sufficient runs to win the match, the whole of the boundary allowance shall be credited to the side’s total and, in the case of a hit by the bat, to the striker’s score.
So basically once the batsmen complete the first run (which is the only run required to win) then the match ends. If the ball goes to the boundary then that won't count, and therefore the batsman will only be credited 1 run not 4.
However if the ball goes to the boundary before they complete the first run then 4 runs will be given to the batsman (and the team score also), since once it reaches the boundary the match ends.