The 21-year-old Academy graduate returns to the second tier following a successful period on loan with Rotherham United and Coventry City during the last campaign.
Giles made 21 appearances for the Sky Blues before joining Rotherham in January, where he made an immediate impression, scoring twice in his opening three matches for the Millers – both coming in 3-0 wins.
The England under-20 international had previously enjoyed loan stints with Shrewsbury Town, the side he made his Wolves first-team debut against during the club’s run to the 2018 FA Cup semi-final, and hometown club AFC Telford United.
The move to south Wales is the latest step in Giles’ development, as the versatile left-sided player learns under former Wolves bosses Mick McCarthy and Terry Connor.
Technical director Scott Sellars said: “It’s a fantastic opportunity for Ryan to gain more experience after a good season at Coventry and Rotherham last year, because the Championship is a brilliant league to help a player develop for the Premier League.
“Bruno has seen him work since we returned for pre-season last week and he believes this move will be the next and best step forward for Ryan.
“Cardiff are a fantastic club with a great stadium and training facilities, and with Mick and Terry, two excellent coaches and a vastly experienced management team, we hope he will get the opportunity to do what he does really well, which is take players on and cross into the box.
“His stats last year in terms of his assists and his crosses into the box, while playing for teams who were struggling, were as good as anyone in the league, so we’re hoping this move will really allow Ryan to kick on and demonstrate what he’s best at.”