The Danish stopped, who signed for Brentford B in 2019, quickly advanced to the first team the following year.
Roerslev has made 146 appearances for Brentford, including 94 in the Premier League, and scored two goals.
Brentford director of football Phil Giles told club media: “Mads has done an absolutely fantastic job for us since he joined our B team. He is the perfect example of why we set up the B team in 2016 - we wanted to bring in talented young players who needed some development and a pathway to first-team football.
"When he’s had his chance, he has always made a positive impact on the team and contributed with some important goals and assists.
"Mads now has the chance to become a first-choice right-back at a very good club and hopefully cement his position in the Denmark national team.
"Wolfsburg will have the option to buy Mads in the summer, so we aren’t sure at this stage whether he will be back with us again for next season.
"But if the match against Crystal Palace was his final Brentford appearance, then he couldn’t have wished for a better result and performance.”