Ballance, who played 23 Tests and 16 ODIs, last turned out for the White Rose is September 2021 and subsequently saw his playing career derailed by racism allegations and mental health struggles.
He was named by Azeem Rafiq as one of the Yorkshire team-mates who used racially discriminatory language, claims Ballance admitted and apologised for during a meeting between the former friends earlier this year.
The 33-year-old is also facing an England and Wales Cricket Board charge of bringing the game into disrepute and did not make a single first team appearance last season.
He subsequently asked for the final two years of his contract to be cancelled, with Yorkshire agreeing on the understanding he would not play for a new county next summer.
It has previously been suggested that Ballance could return on a full-time basis to his native Zimbabwe and seek an international comeback with the country of his birth.
"It has been a privilege to play for this great club. On a personal level, I have gone through a challenging period - and after much discussion I decided, together with my family, that it would be right to make a change," said Ballance.
"I asked the club if it was willing to release me from my contract, and I am grateful for its understanding as we have reached agreement.
"The support Yorkshire has given me off the pitch over the past year has been fantastic and I am appreciative of the Club's help, but I hope that my decision will mean that my career can have a fresh start."
Darren Gough, Yorkshire's managing director, said: "We are sad to see Gary go, but he leaves with our best wishes. He has been a mainstay of our side for many years, and a superb batsman.
"As a club, we recognise that the last 18 months have been difficult for Gary, for numerous reasons, and the most important thing for him is to get better and play again. He felt he could not do this at Headingley, and we agreed to his request reluctantly but knowing that it was the right decision for him personally".
Meanwhile, Yorkshire have announced the signing of New Zealand pace bowler Neil Wagner for the first 10 LV= County Championship games next season. He joins incoming captain Shan Masood as Yorkshire look to bounce straight back following relegation last season.
"I've always enjoyed playing my cricket in England and to be getting this opportunity again at such a big club like Yorkshire CCC is a great honour," said the 36-year-old Wagner.
"I feel like I can offer a lot to the team with my experience, attitude and skill set, so I can't wait to get going. I want to be a big part of helping move the team back up into Division One."