Scotland winger Ritchie, 26, featured 42 times last season as the Cherries maintained their top-flight place.
“It’s an unbelievable feeling to come to a football club like this,” said Ritchie.
“I loved it at Bournemouth – I had a fantastic time there and it had a huge impact on my career. But when a club like Newcastle comes calling, I couldn’t pass up this opportunity.”
Both fees are undisclosed, but Gayle’s move – which happened on the day Newcastle’s England winger Andros Townsend went in the opposite direction in a separate deal – is reported to be worth £10m, while Ritchie’s signing is believed to have cost around £12m.
The attacking pair are manager Rafael Benitez’s second and third signings since the club’s relegation from the Premier League, following Wednesday’s arrival of goalkeeper Matz Sels.
“Dwight is a great player, a proven goalscorer, and it is fantastic news that he has joined us,” said the 56-year-old Spaniard.
“We have been following some wingers for a while and Matt was one of the best prospects for this team.
“He has great ability and pace, and as soon as we knew that Andros Townsend could be leaving, our priority was to finalise this deal.”