The Las Vegas Raiders released Williams in February after two seasons.
He signed a four-year, $44.3-million deal with the Raiders in 2019. However, he managed to haul in just 42 receptions for 651 yards and six touchdowns through 14 contests due to injuries.
The 29-year-old missed the entire 2020 season with a torn labrum.
Williams spent the first four years of his career with the Los Angeles Chargers after going undrafted in 2015.
In Detroit, he'll reunite with his former head coach Anthony Lynn, who is now the Lions' offensive coordinator.