The former Everton and Manchester United manager replaces Sam Allardyce, who was announced as the coach of England's national team on Friday.
Moyes comes in after Sunderland secured their Premier League safety under Allardyce's guidance last season, and his first match will be against Pep Guardiola's Manchester City at 5:30pm BST on Saturday 13 August.
“I am delighted to have joined Sunderland," Moyes told safc.com. "I am relishing the challenge and excited by the opportunity.
“I have taken over a big British club, with a great support and I’m looking forward to working in the Premier League again.
“I look forward to continuing the good work done by Sam."
Moyes has taken charge of 461 Premier League matches so far, a figure only surpassed by Allardyce (467) and three other managers in the competition's history.
Most Premier League matches as manager
He took over at Everton in 2002 and enjoyed 11 successful years at Goodison Park, leading the Toffees to fourth place and UEFA Champions League qualification in 2004/05, as well as regular top eight finishes.
As a result he replaced Sir Alex Ferguson as Manchester United manager in the summer of 2013, helping the Red Devils to the Champions League quarter-finals and seventh in the table before departing in April 2014. He then went on to Real Sociedad in November 2014 and spent a year at the Spanish club.
Moyes won 10 Premier League Manager of the Month awards and the League Managers' Assocation Manager of the Season on three occasions in his 12 years in England's top-flight prior to his appointment at Sunderland.