Heffernan's ruthlessness in front of goal was the difference between the two mid-table Scottish Premier League sides, who both struggled for fluency and failed to create many chances between them.
The first half was a scrappy affair although James Fowler could have put Kilmarnock in front in the third minute, his long-range effort not going far over the bar.
Jamie Walker headed over for Hearts but it was Kilmarnock who took the lead two minutes before the break when James Dayton put over a cross and an unmarked Heffernan nodded in from close range.
Hearts lost defender Darren Barr with a nasty looking head injury, and that caused six minutes of first-half injury-time, but neither side profited from it and Killie went into the break narrowly in front.
Cammy Bell came to the rescue for Kilmarnock early in the second period, making a fine save to keep out Scott Robinson's half-volley as Hearts increased the pressure.
Sub John Sutton set up Walker but his shot was straight at Bell and Sutton headed another chance over the crossbar on the hour mark.
But Hearts were leaving gaps at the back and they were made to pay when Kilmarnock added to their lead on 65 when Heffernan reacted quickest to score his second from a William Gros knockdown.
His hat-trick came six minutes later when James MacDonald pushed away a shot from Borja Perez, and it fell perfectly for the striker who made no mistake in putting the rebound into an unguarded net.
Hearts produced little else to excite their fans in the second half, bar David Ngoo having a header cleared off the line, and Kilmarnock were able to cruise to their third win of the season over the Edinburgh side.