The 32-year-old had a successful career in New Zealand with the Auckland Blues, before spells with Munster and Aironi in Europe.
Williams joined Ulster in 2012 and was named as the PRO12 Player of the Season at the end of his debut season. He has gone on to make 67 appearances for the Province, scoring 13 tries, during a four-year spell.
Commenting on the move, Williams said: "I've thoroughly enjoyed my time in Belfast. The Ulster people are special and the supporters have always been so good to me. My daughter was born in Ireland so it will always be a special place for our family.
"Rest assured, I'll be giving everything for the team until the end of this season. We have set our targets over the next five months and I want to play my part in us achieving them."
Bryn Cunningham, Ulster's Operations Director, added: "We wish Nick, Gemma and the kids the very best of luck with their new challenge in Cardiff. They will be missed by all.
"Nick is a true gentleman and a real fans' favourite. He is currently producing some excellent rugby for Ulster and I know that he will continue in the same vain for the rest of the season, with so much still to play for.
"While we are unable to see Nick in the white of Ulster after his current contract, I want to take this opportunity to thank him for all his efforts over the past four years. His physicality, barnstorming runs and off-loading abilities are always exciting to watch and we've told him not to do quite as much next season when playing against us!
"Over the next period we will be able to announce Nick's replacement, which will be a top class addition to the squad moving into next season."