Baum, who became the city's chief legal adviser in July 2004 and earned nearly $240,000 in 2009, will step down Oct. 31, the city announced.
In recent years, Baum has won multiple awards for his pro bono work on behalf of victims of domestic violence. But he has also faced criticism from several members of the City Council, most notably Mayor Pat Burt and Councilman Larry Klein.
The city attorney is one of four positions appointed by the council, the others being the city manager, city clerk and city auditor.
"I have been honored to serve as Palo Alto's city attorney and am proud of the work that my staff and I have done on behalf of the City over these past six years," Baum stated in an announcement issued Thursday.
"My tenure has been an incredible opportunity for me to serve the City and its residents; however, now I'm ready to pursue my interest in tackling municipal law in a different format, either by joining a law firm or starting my own practice."
He also said he was "pleased to leave on a high note, knowing that the City Attorney's Office is left in the capable hands of this professional staff."
In the announcement, Baum is credited with cutting costs, assembling a capable legal staff and assisting the city in resolving "many legal problems."
City Manager James Keene called Baum a "dedicated public servant" and said the city's leadership "wishes him the best in the next phase of his career."
Burt said of Baum: "Gary has been committed to minimizing legal risks to the City, and he is regarded highly by his peers."
In recent years Baum has helped Palo Alto form the five-city Peninsula Cities Consortium, a coalition that regularly meets to discuss strategies for dealing with the proposed high-speed-rail program. The coalition also includes Menlo Park, Atherton, Belmont and Burlingame.
In October, when the city was facing a possible workers' strike, Baum succeeded in having 87 workers designated as "essential employees," a designation that would have barred them from striking had the strike occurred.
In March 2009, after a resident criticized Baum during a public hearing, then-Mayor Peter Drekmeier responded by saying the council has "full confidence in our city attorney" and called him "one of the best around."
But other council members at times have expressed their displeasure with his legal advice. On Monday, several council members said they were disappointed with Baum's report on the city's proposal to split sidewalk repair costs with the residents. The council ultimately scrapped the proposal.
At a recent meeting, Klein refused to abstain from a routine vote on agenda order despite Baum's advice that he do so (one of the items on the agenda related to Stanford University, where Klein's wife is an employee).
Klein, Burt and Councilman Greg Scharff also advocated cutting one of the legal secretaries in the City Attorney's Office, a proposal Baum resisted over a series of meetings. The proposed cut was ultimately rejected by the full council.
Baum's next performance evaluation was scheduled for July 27.
Baum has received wide recognition for his pro bono work on behalf of domestic-violence victims. He received the Pro Bono Attorney of the Year award from the Santa Clara County Bar Association in 2007 and the Access to Justice Award from the Pro Bono Project in 2009.
According to the city's announcement, Baum's retirement from the city will "afford him the opportunity to spend more time on pro bono legal work."
Klein, as chair of the council's Council Appointed Officers (CAO) committee, said the full council will likely consider hiring a consulting firm for the city attorney search on July 12 or July 19.
A list of semi-finalists would then be presented to the council, which would select two or three finalists for interviews and background checks.
Klein said he doubted a new attorney could be named by Baum's Oct. 31 retirement date, but he expects one could be named soon after, possibly in November and almost certainly by the end of the year.