Terms of the contract were not immediately available.
The 2020 season was a career year for Wilson, who set personal bests with 126 carries, 600 yards and seven touchdowns.
Wilson added another 133 receiving yards with three touchdown catches, for good measure.
He was the top tailback in the Niners' stable when Raheem Mostert missed games (Mostert played just eight). If both are healthy at the start of next season, San Francisco will be in great shape at running back.
Just who else is around them remains to be seen.
Heading into the offseason, the Niners have a number of players up for new contracts, including Trent Williams, Richard Sherman, Solomon Thomas, Kyle Juszczyk, Kendrick Bourne, K'Waun Williams, Ben Garland, Ezekiel Ansah and Jordan Willis.
Running backs Tevin Coleman and Jerick McKinnon are also free agents.
As the Niners' 2021 roster begins to come together, it's clear that locking up Wilson, 25, was a priority.