World number 10 Federer claimed the first set before being broken for the first time at this year's tournament in the first game of the second set.
Wawrinka, the world number three, went 2-0 ahead before Federer won three games in a row on his way to the title.
Elena Vesnina beat Svetlana Kuznetsova 6-7 (6-8) 7-5 6-4 in the women's final.
Federer becomes the oldest champion in the tournament's history, surpassing Jimmy Connors, who was 31 when he triumphed in 1984.
This was the 23rd meeting between Federer, an 18-time Grand Slam winner, and Wawrinka.
Federer, 35, has beaten his compatriot, who was in tears at the end, 20 times.
"This has been a fairy tale week," said Federer. "It's a beautiful feeling. Maybe it's not as surprising as Australia but it's still great to back it up by winning in Amercia.
"It's a dream start to the year. I have totally exceeded my expectations. It's been an unbelievable start to the year." - BBC -