The 32-year-old Massa will partner with Finnish driver Valtteri Bottas next season, following in the footsteps of Brazilian drivers Ayrton Senna and Rubens Barrichello, who both drove for the British team.
"I'm glad to be signing with another icon of the sport following my time at Ferrari,'' Massa said in a statement after agreeing to a multiyear deal. Terms and length of the contract were not released by Williams.
Massa has 11 race wins in his career, which includes two seasons at Sauber, and finished second in the 2008 world championship to Lewis Hamilton by one point. But the Sao Paulo native has struggled since a near-death crash at Budapest in 2009.
Massa will be replaced by former teammate Kimi Raikkonen at Ferrari, with Maldonado reportedly set to take the Finn's seat at Lotus.
"I'm highly motivated to start working hard from the very beginning in what is an exciting new challenge in my career,'' Massa said. "I hope my experience will be useful in helping the team in its effort to move on from a difficult period.''
Williams is having a disastrous season, with Maldonado earning the British team its lone point of the season.
"[Massa] brings a wealth of experience as we begin a new chapter in our story,'' team principal Frank Williams said.
F1 will introduce a new V6 engine plus major rule changes from next year, and Massa feels optimistic about his new team's chances with a regulations shake up.
"I don't remember seeing so many new rules in a single season,'' Massa said, "and I'm fully prepared to work with everyone at Grove to make sure we find the right direction.''
Maldonado leaves after three seasons with Williams, where the Venezuelan driver won the Spanish Grand Prix in 2012.