Cheika, formerly in management roles with Stade Francais and Leinster, played for New South Wales in the late 1990s and comes in after Foley's controversial move to the Force in July.
Cheika, who played for Australia at under-21 level, turned down an offer from the Force before Foley was appointed.
Former Wallabies assistant coach Tim Lane and former rugby league star Phil Blake had both been shortlisted for the Waratahs post but the vote went to Cheika.
Cheika spent five years in charge of Irish province Leinster and the past two seasons as director of rugby at Stade Francais.
In a statement, the 45-year-old said: "The opportunity to coach the Super Rugby team of my home state and the responsibility to make all our supporters and all people from NSW proud of their team is one that motivates me immensely.
"I am really looking forward to being part of this new era in NSW rugby and will bring all the passion and professionalism I have to make this team one everyone will be proud of.
"My immediate goal is to establish our identity loud and clear, inside and outside of the team; who we are, how we are going to play the game and what we are prepared to do to earn the respect of our team-mates, our supporters and our competitors, as individuals and as a team.
"By achieving this we will earn the right to think about getting some good results."