Bassitt is guaranteed $8.8 million as part of the deal, which avoided an arbitration hearing set for Monday.
The deal includes a $19 million mutual option for 2023 with a $150,000 buyout. If the option isn't exercised by both sides, the 33-year-old right-hander would become eligible for free agency after the World Series.
Bassitt is 4-2 with 2.77 ERA in eight starts this season, striking out 49 and walking 13 in 48⅔ innings.
He was acquired by the Mets from payroll-paring Oakland on March 12 for minor league right-handers J.T. Ginn and Adam Oller.