Gardner, son of 1987 500cc world champion Wayne, was informed by KTM last month that he would not be staying at Tech 3 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 Motorsport.com 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.
Yamaha Europe has now announced 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 in place of the retiring Eugene Laverty.
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 Tech 3 KTM teammate Raul Fernandez will stay in MotoGP for the next two years with RNF Aprilia, while the Australian's place at Tech 3 will be taken by Moto2 frontrunner Augusto Fernandez.
Earlier this week, LCR announced 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.