Gomes has made 122 appearances for the Hornets and his new deal will run until June 2019.
"Watford FC is delighted to announce that goalkeeper Heurelho Gomes has signed a new two-year deal with the club," a club statement read.
"The 36-year-old has put pen to paper on a contract which takes him through to June 2019."
The Brazilian joined Watford from Tottenham in 2014 and has become a fans' favorite at Vicarage Road.
The 36-year-old was voted the club's player of the season in 2016 and has won the players' player award for the last two seasons.
Gomes played a key role as Watford secured promotion to the Premier League in 2015 before helping them finish 13th in their first campaign back in the top flight.
They will now be hoping to improve on last season's 17th-place finish under new head coach Marco Silva.