The 27-year-old was named Yorkshire captain in December.
"The new deal has come at the perfect time for me," Ballance told the club website. "I can now purely focus on the captaincy, batting and scoring runs."
The Zimbabwe-born left-hander has played 21 Tests for England, the last of them against Bangladesh in October.
After being recalled to the Test team for last summer's home series against Pakistan, Ballance made just 24 runs in four innings during England's drawn series in Bangladesh and did not feature in the 4-0 defeat in India at the end of 2016.
Ballance will captain Yorkshire in all three formats in 2017 having replaced Andrew Gale, who retired to become Yorkshire head coach in November.

Stoneman, 28, has scored 14 centuries in 118 first-class matches, but is yet to receive a call-up for England.
"He's scored a 1,000 runs two years in a row now and people are just starting to mention him." Onions told BBC Sport.
"His volume of runs have made him basically selectable. You have to pick him - pure volume of runs."
Newcastle-born opener Stoneman was named the club's batsman of the year last season, having been one of only five Durham players to feature in every championship game.
"People don't even talk abut him really. He's been on no Lions tours, he hasn't even been involved in any kind of squads," 33-year old Onions added.
"It might be quite hard for him to take that."
But Onions, who has nine Test caps for England, is confident Stoneman will be considered for selection this year, and could put fellow batsmen under pressure.
"I think Mark Stoneman is certainly one of the guys that England will be looking at," he added.
"Whether or not [Alex] Hales is under a little bit of pressure - I think he'll go into the start of the season in a couple of months really having to score as many runs as he possibly can."
England batsman Gary Ballance has signed a new contract with Yorkshire which will keep him at Headingley until the end of the 2019 season.
[NEXT_CONCEPT]
Durham bowler Graham Onions says teammate Mark Stoneman has to be picked for international honours based on his "pure volume of runs".