The German's switch from Red Bull for next season was announced minutes after Alonso's departure was confirmed.
Two-time world champion Alonso, 33, is expected to join McLaren.
The Spaniard still had two more years to run on his contract with Ferrari but he and the Italian team have agreed to part company.
"It was not a special moment of the year that I opened my eyes," he said. "Last year I had some doubts about 2014.
"I knew that it was a big change of regulations so I thought best thing to check how the 2014 new turbo era was going for Ferrari.
"I had a very close relationship with president [Luca] di Montezemolo. We talked every week and we more or less agreed that if this year we were not competitive again we could think of different options.
"In the summer break it was time to sit with the president and say, 'OK, I would like to go'."
McLaren will not announce their two drivers until at least 1 December as they decide whether to retain Jenson Button or Kevin Magnussen alongside Alonso.
Vettel will partner former world champion Kimi Raikkonen at Ferrari.
"Scuderia Ferrari has decided to put its faith in the youngest multiple champion in the history of Formula 1," said team boss Marco Mattiacci.
Ferrari last won the world drivers' title in 2007, when Raikkonen finished top in his first stint with the Italian team.
"Sebastian Vettel is a unique combination of youthfulness and experience," added Mattiaci.
"He brings with him that sense of team spirit which will prove invaluable when, together with Kimi, they tackle the challenges awaiting us, as we aim to be front runners again as soon as possible."
"Without a shadow of a doubt, these five years produced some of the best moments of my career and I also feel that, in leaving the team, it is family rather than friends I am leaving behind," said Alonso, who narrowly missed out on the world title to Vettel in both 2010 and 2012.
"We offer him our heartfelt thanks for what has been an extraordinary adventure with the Scuderia, when in the past five years, he twice came so close to winning the world championship."
"Alonso's reputation as arguably the most complete F1 driver of all has only been enhanced by his battles against the odds in inferior cars over the last five years," said Benson.
"Despite being considerably more successful in statistical terms, Vettel is not held in as high regard within the sport.