However, Alonso will remain part of the Toyota family and will explore "new challenges" with the Japanese manufacturer.
Alonso joined Toyota last year ahead of the new super season of the WEC, and won Le Mans on his journey to pick up the Triple Crown.
However, he will step down after just one season in the championship while Brendon Hartley, a former WEC champion, will take his place at the team.
"I have enjoyed being part of Toyota Gazoo Racing in WEC, but this chapter is ending," two-time F1 champion Alonso said.
"Winning the Le Mans 24 Hours [in 2018] is one of the highlights of my career as part of my triple crown challenge and I will always remember the victory we achieved together as a team last year.
"Now is a good time to take on new challenges and there are many interesting opportunities to explore within Toyota Gazoo Racing."
Toyota team president Hisatake Murata added: "I am sad to say goodbye to Fernando and would like to thank him a lot for his contribution to this fantastic season during which he has written his name in Toyota's motorsport history.
"His passion, desire to win and willingness to chase his dreams is truly impressive."
Hartley won the WEC in 2015 and 2017 with Porsche, but was forced to look at new options after the German manufacturer left the championship in 2017.
The Kiwi managed to secure a 2018 seat in Formula 1 at Toro Rosso, having made his debut towards the end of the 2017 season.
"I know how professional and motivated this team is following my years competing against them in WEC, so I'm fired up and very happy to be joining them," Hartley said.
"I believe I am returning to WEC an even stronger driver following my experience in F1 and I look forward to getting on track and building a strong relationship with my new team."
Bahrain International Circuit - Winter testing