Barnes' previous deal was due to expire in 18 months.
The new agreement also includes an option for a further year which can Burnley can choose to activate.
Club record holder
No Burnley player has made more Premier League appearances (146), or scored more goals (36), in the top flight.
Barnes joined from Brighton and Hove Albion ahead to the 2014/15 season, helping his new team to promotion from the Championship.
His goalscoring record has steadily improved since their return to the first tier in 2016.
The 2018/19 campaign was his most prolific yet, with 13 strikes across all competitions.
Barnes flew out of the blocks this season with four goals in his first three league matches but has since endured a frustrating goal drought.
'I want to stay until I retire'
The 30-year-old took the opportunity after signing on the dotted line to express his ambitions.
He intends to secure yet another deal in three years' time and, eventually, hopes to bow out of the game as a Premier League player.
"I'd like to see out my playing days here," the Bath-born forward said.
"At this moment in time I don’t see anything else for me and I just want to continue playing at the highest level possible, and hopefully that is with Burnley.
"I just want to carry on playing and I want another contract after this. When you're in your 30’s people say you're almost done, but for me I want to play as long as possible.
"I've still got a lot to learn and a lot to achieve and I want to stay in the Premier League until I retire."