The Panthers cut Shepard on Monday after he declined their offer of a pay cut.
Shepard made only 17 receptions for 202 yards and a touchdown last season after signing a three-year, $10 million deal with Carolina.
The Bills need depth behind Kelvin Benjamin, and Shepard has experience.
He spent the first four years of his career with Tampa Bay. In 72 career games, Shepard has 47 catches for 634 yards and four touchdowns.