Max Verstappen (left) and Sergio Perez (right) have taken Red Bull to the top of the constructors' standings this season
The 32-year-old won Sunday's Monaco Grand Prix and is third in this season's driver standings.
Along with defending world champion Max Verstappen, Perez has helped Red Bull to the top of the constructors' standings after seven races.
Team boss Christian Horner said keeping Perez was a "no-brainer".
Perez joined Red Bull from Racing Point at the end of 2020 and finished fourth in the 2021 drivers' championship after his most successful season in Formula One.
Red Bull announced the extension on Tuesday, but Perez had actually signed before the race in Monaco, where he claimed his fourth podium finish of the season.
Perez said: "For me, this has been an incredible week, winning the Monaco Grand Prix is a dream for any driver and then to follow that with announcing I will continue with the team until 2024 just makes me extremely happy.
"I am so proud to be a member of this team and I feel completely at home here now. We are working very well together and my relationship with Max, on and off the track, is definitely helping drive us forward even more."
Horner believes the Mexican has significantly developed during the past 12 months and is now operating at a standard similar to that of the reigning world champion.
He said: "Time and again he has proved himself to not only be a magnificent team player but as his level of comfort has grown he has become a real force to be reckoned with at the sharp end of the grid.
"This year he has taken another step and the gap to world champion Max has closed significantly."
-- Courtesy of BBC Sport