Federer, who has become the oldest champion in the tournament's history, has now won 20 of his 23 meetings with his compatriot.
Wawrinka (3) sits seven places above Federer (10) in the world rankings, but the 31-year-old struggled to upset his opponent's rhythm in California and lost the opening set 6-4 after conceding his final service game of the set.
Federer lost his opening service game of the second and what proved to be final set, but the 35-year-old hit back to level at 2-2, and ultimately claimed the title after breaking Wawrinka at 5-6.
"This has been a fairytale week. 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 America It's a dream start to the year. I have totally exceeded my expectations. It's been an unbelievable start to the year," Federer told reporters after landing the title.