Heck is a euphemistic, mild word for hell, used in exactly the same way, like gosh is to god and darn is to damn. It's usually favoured by the sort of people who are concerned about blasphemy (even though it is still blasphemy) or in situations where you want to use mild language (e.g. if there are children present).
Gosh darn it, what in the heck is that? = God damn it, what in the hell is that?
Silver Biscuit is right, but there are other reasons to use it other than just fearing being offensive to gods or children. You might use heck instead of hell if you're speaking to people you don't know very well, or even just because it sounds funnier. In this context, the person doesn't want to express real anger, only humorous annoyance, and so is using a word (heck) that is less serious or heavy than "hell" would be.