The agreement was first reported by The Vertical.
The Rockets had a busy Saturday. Before reaching the deal with Gordon, they also agreed to terms with power forward Ryan Anderson, his agent told ESPN's Marc Stein.
Finding another outside shooter to complement newly hired coach Mike D'Antoni's up-tempo offensive system was next.
Gordon has never played a full 82-game season, but he was snagged to give shooting guard James Harden another playmaker on offense, something Harden and D'Antoni talked about prior to the start of free agency.
But Gordon's career with the Hornets/Pelicans has been defined by his time off the court. The former seventh overall pick out of Indiana played just nine games in the lockout-shortened 2011-12 season, and he has missed an average of 29 games per season since. In large part because of injuries, the eight-year veteran never turned into the offensive dynamo he seemed to be ready to become after averaging 22.3 points per game with an 18.56 player efficiency rating in his third and final season with the Clippers.
Gordon averaged a respectable 15.3 points and 39 percent shooting on 3s in five seasons with New Orleans, but he routinely shot in the low 40s from the field and never topped a 16 player efficiency rating in a season when he played double-digit games.
After rejecting a four-year extension from the then-Hornets in January 2012, Gordon signed a maximum offer sheet worth $58 million over four years with the Phoenix Suns that summer to play for then-coach Alvin Gentry. Despite Gordon's declaration via a statement that "Phoenix is just where my heart is now," New Orleans matched the deal for the restricted free agent.
Gentry was hired as Pelicans coach last offseason, and Gordon's first season under him resulted in a 56.6 true shooting percentage -- the highest of the guard's New Orleans career.
But Gordon finished 2015-16 ranked 27th among shooting guards in real plus-minus (minus-0.48) and missed 37 games after breaking the ring finger on his right (shooting) hand twice as the Pelicans sputtered to a 30-52 record.
Information from ESPN.com's Calvin Watkins and Justin Verrier was used in this report.