The Celtics trailed by 13 with 10:30 to play, but battled back to tie it on a layup by Jeff Green with 12 seconds to go.
After a time out, Curry was given the chance to hit the game-winner and he came through with the last of his 19 points.
Boston's Gerald Wallace then missed a 3-point try at the buzzer.
Golden State won for the 11th time in 12 games, bouncing back from a loss to Brooklyn Wednesday that snapped its 10-game victory streak.
Andre Iguodala paced the Warriors with 22 points, five rebounds and seven assists. Curry had seven rebounds to go with his 19 points and Klay Thompson scored 17.
Boston's losing streak reached seven games. Green scored 24 points to lead the Celtics.