Wiliams has represented Wales at Under 20 and will compete with England internationals Danny Care and Andy Gomersall as well as Samoa's Steve So'oialo for Quins' number nine jersey.
He joins fellow Welshman, once-capped prop Ceri Jones, at The Twickenham Stoop. He said: "I'm delighted to get a chance at the top level and in such a professional environment. "It's the chance I've wanted for a long time and I'm looking forward to the challenge."
Williams has also played for the Barbarians, Glamorgan Wanderers and the Blues and Ospreys Academy teams.