The 40-times capped No 9 has missed the RBS Six Nations championship because of injury. But the man who toured New Zealand with the 2005 Lions is getting ready to return to action again and will be vying for a place in Ian McGeechan's squad this summer.
It will be Cooper's third spell at a Welsh club having previously played for Cooper has already played for the Celtic Warriors and Newport Gwent Dragons. He spent the early part of his career at Bath.
"Gareth has proven over the years that he is a quality scrum half and will be a great addition to our squad next season. There was obviously a lot of interest in him, so it's a real boost to us that he has chosen to join the Blues," said Blues coach Dai Young.
"He performed admirably for Wales during the Autumn internationals and it's great that we are able to bring him back over the border."
Cooper is set to form a new half-back partnership at the Blues following the recent signing of Waratahs and Australian utility back Sam Norton-Knight.
And while Cooper is heading west over the Severn Bridge, the Blues' Welsh international stand-off Nicky Robinson is going the other way to Kingsholm. Nicky's decision to join Gloucester follows the switch by his brother Jamie to Toulon next season.