Cooper's move to Kingsholm has been announced following confirmation of England scrum-half Peter Richards' exit from Gloucester to their Guinness Premiership rivals London Irish.
Cooper, 27, joins the west country club from Newport Gwent Dragons, where he will compete for a first-team place alongside Scotland's Rory Lawson and Irishman Mike Prendergast.
Cooper has won 30 caps and was a member of the 2005 British and Irish Lions squad that toured New Zealand.
He said: "This is the opportunity of a lifetime for me, and (head coach) Dean Ryan's ambition to make Gloucester the dominant force in club rugby is something I want to be part of.
"I know a lot of people say it, but when you see the training facilities and understand the direction in which the club is heading, my mind was made up. I think this will be a fantastic move."
Ryan added: "Gareth has all the qualities you would associate with an international number nine, and his ability to break the line can be devastating to the opposition.
"I am really pleased we have been able to recruit Gareth, and I am expecting big things from him next season."