The striker is moving to the Championship outfit on a season-long deal.
Before the switch, Gomez signed a deal to 2022 with Real. The agreement has also seen kid brother Eric join the club's youth team.
Gomez did see action with Castilla at the start of last season before being demoted by coach Santiago Solari. His drawn out new contract talks were blamed for the stand off.