Riley, 30, made 30 appearances as Wrexham finished 13th in the National League, but was let go at the end of the season.
The centre-back began his career at Wolves and has also played for Kidderminster, Mansfield and Tranmere.
He becomes Halifax's first signing since achieving promotion to the National League via the play-offs.
FC Halifax have signed defender Martin Riley on a one-year contract following his release by Wrexham.