The 27-year-old joins the Bluebirds for an undisclosed fee, putting pen to paper on a contract which will keep him at the Cardiff City Stadium until the summer of 2021.
"It's fair to say that I've been an admirer of Greg for a number of years and that he's consistently been one of the best left-sided defenders for club and country," Cardiff manager Neil Warnock told the club's official website.
"We're delighted to have his experience and knowledge so as to supplement Joe Bennett who had a great time last season. I anticipate that Greg coming in will give us a lot of strength down that left-hand side."
Cunningham, who began his career with Manchester City, leaves Deepdale after three seasons with Preston.