The 33-year-old France international has also taken a significant pay cut to help Marseille deal with the financial implications of the coronavirus pandemic.
Payet is in his second spell as a Marseille player, having initially joined from Lille in the summer of 2011 before departing for West Ham United two years later. He rejoined Marseille after a season-and-a-half in England.
Payet scored nine goals and provided four assists in 22 league games for Marseille in the 2019/2020 season before Ligue 1 was ended early because of the coronavirus pandemic.
“I’ve often said that I love this club and that my family feels good here,” the club's vice-captain explained.
“The idea came into my head when the president said that the players should make an effort. And who better than me to lead by example?
“Saying you love the club is one thing, but showing it is better. I really want to be part of OM and help it grow.”
Marseilles president Jacques-Henri Eyraud added: “Dimitri came to me to tell me that he wanted to be, and I quote: ‘Marseillais for life.’
“He explained to me that he really wants to end his career here. And beyond finishing his career, pursue a real reconversion at the heart of the club he loves so much.
“He’s accepted to cut his salary for 30% for the 2021-22 season. In the two additional years, he has agreed that his basic salary will be cut between 40% and 60%.
“He’s given up his qualification bonuses for European competitions and a very large part of his payment over the last two years of his deal will only be guaranteed if he is a starter. If he’s not in a position to speak on the park, then his wage will be dramatically reduced for a player of his experience and his quality.
“This unprecedented effort shows the attachment that Payet has to this club.”
Marseille will play Champions League football next season after finishing second in the league.