No financial details of the transfer were disclosed.
"It's an unbelievable feeling to come to a football club like this," Ritchie told Newcastle's website(www.nufc.co.uk).
"It's fantastic to be here and I'm really looking forward to the challenge of getting the club back in the Premier League."
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
The Scottish international made 142 appearances for the south coast side, helping the club to a double promotion from League One (third-tier) during his three-and-a-half year stay with Bournemouth.
The winger becomes manager Rafael Benitez's third signing of the summer following the arrival of Gent goalkeeper Matz Sels and striker Dwight Gayle from Crystal Palace.
Striker Callum Wilson has also signed a new four-year deal with Bournemouth, keeping him with the side until 2020, the club said on Friday.
Injury restricted the 24-year-old to just 13 appearances for Bournemouth last season, after scoring 23 goals in all competitions to help his side secure promotion in the 2014/15 season.
"Callum has constantly improved during his time here," Bournemouth's chief executive Neill Blake told the club's website (www.afcb.co.uk).
"Only his injury stopped him from having a big impact in the Premier League last year, now back to full fitness, we're excited to see Callum continue to improve over the next four years."
(Reporting by Nivedita Shankar in Bengaluru, editing by Ed Osmond and Angus MacSwan)
