While terms were not disclosed by the Bills, Allen's deal calls for a four-year contract with a team option for a fifth season.
The signing of Allen, who was the seventh overall pick of the 2018 NFL Draft, completes the Bills' draft class as players report to training camp on Wednesday. The team traded up to select Allen, as it shuffled the Nos. 12, 53 and 56 picks to the Tampa Bay Buccaneers in the deal.
Allen joins fellow quarterbacks Nathan Peterman and AJ McCarron on the roster.
The 6-foot-5, 237-pound Allen threw for 1,966 yards with 19 touchdowns last season at Wyoming. He ran the 40-yard dash at the NFL Scouting Combine in 4.75 seconds with a 33 1/2-inch vertical jump.
SIGNED.— Buffalo Bills (@buffalobills) July 25, 2018
Josh Allen is officially a Buffalo Bill! 🙌 pic.twitter.com/PzrdNYCw1H
Allen received a positive review last month from running back LeSean McCoy, who labeled him a "special" player.
McCarron, signed as a free agent in March after being a backup with the Cincinnati Bengals, is the front-runner for the starting job. He has played in 11 NFL games and has not started one since 2015.
Peterman started two games for the Bills last season, and the team went 1-1 in those starts. He completed 49 percent of his passes with two touchdowns and five interceptions in the four games he played last season.