The deal is worth $1.2 million with incentives that could earn him a total of $2.5 million, according to the NFL Network.
Known for his ability to make catches out of the backfield as well as run the ball, Westbrook spent his first eight seasons with the Philadelphia Eagles where he set franchise records in yards from scrimmage (9,785) and touches (1,734).
A two-times Pro Bowler, Westbrook has been prone to injury and was released from the Eagles after playing in just eight games last season.
In San Francisco, Westbrook will be paired with power runner Frank Gore.
(Reporting by Jahmal Corner in Los Angeles; Editing by Peter Rutherford)