The midfielder has become a key player for the Bluebirds since arriving from Aston Villa in 2007.
He has played over 250 games and scored more than 60 goals.
Mackay told the club's official website: "We're absolutely delighted that Peter has committed himself to the club for the longer term, following a couple of top flight clubs coming in for him.
"I had a good conversation with him and he has decided to commit his future here, so on behalf of my staff and the club, we are happy to back that commitment by improving the terms of his contract.
"It's my belief that there's a lot more to come from Peter Whittingham and I'm certainly going to try and help him achieve his goals."
Whittingam was unable to prevent Cardiff losing 4-2 to Bristol City at the weekend.