The 28-year-old, who has 69 caps for his country and represented the British & Irish Lions, will join Quins next season.
Roberts had turned down a deal to return to Cardiff Blues, where he spent six years before moving to France.
"The whole club is ecstatic to have signed a player of Jamie's quality," said director of rugby Conor O'Shea.
"He is massively ambitious and, as a role model to all of our players, he will be someone we can all learn from."
Had Roberts opted to return to Wales, Blues would have had first refusal on Roberts's services under a Welsh Rugby Union agreement with the nation's four regions.
Instead the Newport-born player, who has won the Six Nations three times with Wales, including two Grand Slams, will play in the Premiership at the Twickenham Stoop.
Wales head coach Warren Gatland said earlier this month that a move to England would not preclude Roberts from selection for Wales.
Under the so-called 'Gatland's Law', Wales-based players are likely to be favoured for Test selection over those who choose to play elsewhere.
Roberts, who made his international debut in 2008, will also study part-time for a Masters degree in medical science at Cambridge University during his time with Quins.
"Having played in Cardiff and in Paris, moving to London is a chance for me to experience and further develop my career in a different league," said Roberts.
"My desire to compete and win at both club and international level remains as strong as ever."
Roberts will link up with Harlequins in December, after the Rugby World Cup, and has signed a two-and-a-half-year deal which will run until the summer of 2018.
Harlequins have agreed a deal to sign Wales centre Jamie Roberts from French Top 14 side Racing Metro.