The centre-back, 26, has not played for the Bluebirds since missing a penalty in City's Carling Cup final defeat to Liverpool in February.
He was also left out of Championship Cardiff's pre-season tour by manager Malky Mackay.
"We're delighted to welcome Anthony to Huddersfield because we've worked very hard to seal his signature amid a lot of competition from other clubs," Huddersfield manager Simon Grayson told the club's official website.
"Just like the large majority of our summer signings - the likes of Keith Southern, Joel Lynch, Sean Scannell, Adam Clayton and Oliver Norwood - he has plenty of Championship experience.
"But also he is still a young player who has yet to reach his peak - exactly the type of player I want. He's also a real leader and you can never have enough of those on the pitch. He has a real hunger to succeed too."
Gerrard, cousin of Liverpool and England captain Steven, joined Cardiff from Walsall in 2009 and spent the 2010-11 campaign on loan at Hull City.
The former Everton trainee is the latest of a string of acquisitions by Town manager Simon Grayson as he prepares the newly-promoted Terriers for life in the Championship.