The midfielder will stay until June 2020. The 22-year-old didn't get into the first team at his former club and wants to improve now.
He made only five appearances for Madrid and was before on loan at Getafe.
The midfielder is Valencia's second signing for this season. The first one was the Portuguese Nani.