Espargaro will go into the Italian Grand Prix this weekend third in the battle for the title, having secured one win and three podium finishes this season.
Vinales continues to adapt to the RS-GP, but is 10th in the standings.
"This confirmation [of the new contracts] was just what the doctor ordered," Espargaro said. "We've worked hard together and grown together.
"We were a hope, now we are reality. In 2021, we had already seen clear signs of our steps forward and now we are able to battle consistently with the best in the world.
"Continuing to do so with Aprilia is a source of pride for me. We can grow even more and we want to demonstrate that on the track."
Vinales stated: "I'm extremely happy to continue my work with Aprilia Racing. Now our horizons are expanding and we'll be able to work with continuity to achieve ambitious goals.
"I believe in this project and I'm happy to be part of it. I've found a fantastic environment in Aprilia and this confirmation gives me the peace of mind to grow the way this team and I deserve to."