Gardner – son of 1987 500cc world champion Wayne Gardner – was informed by KTM last month that he would not be staying at Tech3 next year.
The Australian was told he was "not professional enough", though this was something KTM's motorsport boss Pit Beirer denied – with Gardner saying it was KTM's road racing vice president Jens Haibach who told his manager this.
The reigning Moto2 world champion told Autosport during the San Marino Grand Prix weekend that he had some options on the table for 2023, but ruled out staying in the MotoGP paddock as a test rider.
PLUS: How KTM failed one of its brightest MotoGP prospects
Yamaha Europe has now confirmed Gardner will step over to WSBK with the GRT Yamaha squad for 2023, replacing Garrett Gerloff – who will join the Bonovo Action BMW team next year, with Eugene Laverty moving to a managerial role.
Yamaha boss Andrea Dosoli said: "Remy is an exciting young talent, who boasts an impressive career inside the Grand Prix paddock.
"We are obviously delighted to have a rider on board who's not only shown great progression but has experience at the top level of motorcycle racing.
"We believe that he is the perfect fit for Yamaha's WorldSBK programme and are keen to see what he can do on one of our R1 WorldSBK machines.
"We'd also like to thank Garrett Gerloff for his commitment to Yamaha these past three seasons and we wish him all the best for the future."
Gardner's current Tech3 KTM team-mate Raul Fernandez will stay in MotoGP for the next two years with RNF Aprilia, while the Australian's place at Tech3 will be taken by Moto2 frontrunner Augusto Fernandez (who has no relation to Raul).
Earlier this week, LCR confirmed that Takaaki Nakagami will remain with Honda for 2023 after Moto2 frontrunner Ai Ogura elected to remain in the intermediate class for one more season.
Valentino Rossi's VR46 team also confirmed Luca Marini will remain with the team for 2023 alongside Marco Bezzecchi, with the latter having already signed a two-year deal.