Alguacil has taken the club back into European competition during his two-year spell in charge and the board have demonstrated their faith in him with a new contract.
The club has also extended the contract of director of football Roberto Olabe to 2024.
The announcements come amid a downturn in form from a Sociedad team that went unbeaten across 10 matches in all competitions between November 1 and December 13.
Since then, Alguacil's men have suffered 2-1 defeats at Barcelona and Levante before succumbing 2-0 to LaLiga leaders Atletico Madrid on Tuesday.
After a short spell as coach between March and May 2018, Alguacil took charge of Real Sociedad for the second time in December 2018, helping the club finish ninth in the table that season.
Improvement followed in 2019-20, when Sociedad finished sixth and qualified for the Europa League, where they finished second in Group F behind Napoli.