It's a bit like the differentiation between erotic art and porn: "I know it when I see it!"
But it's difficult to determine a set of criteria that will always give you the right answer. I heard the newish Queensryche (post-Geoff Tate, the new singer is great, so was Tate,
that rhymed ...) in the car today and I thought to myself that these guys are generally lumped together with others as thinking man's heavy metal, prog metal or melodic metal, but are they really?
Twisted Sister were regularly billed as heavy metal, but their music was actually light-weight. The Scorpions were sometimes tagged with it, sometimes not, but is their music so fundamentally different to Accept's which were always billed as heavy metal?
Manowar is of course (the one and only) "true metal"
and I guess most people agree that Judas Priest, Saxon, Anthrax and Iron Maiden are (though Maiden's music is much more progish in nature than Priests), but what about Black Sabbath? Bill Ward wasn't really a heavy metal drummer at all and what's so heavy metal about the Sabbath Bloody Sabbath album (admittedly the Sgt. Pepper in their canon)? Even Priest would frequently stray from the recipe.
OTOH they sure knew how to turn rock'n'roll into heavy metal too, to many a sacrilege of Mr Berry's most famous work, but I think that is one of the most daring covers of an old chestnut, love the harmony guitars
:
The Heavy Metal Kids weren't heavy metal at all and the first band I read about that openly described itself as heavy metal in the mid-seventies was BÖC, yet for all their dark image Bloom's men were more of a versatile pop group, adept at many styles.
And before they were discovered as godfathers of punk, the MC5 were filed as heavy metal too (though really only their live album could be called that in places).
Ok, Metallica and Megadeth are metal. Dio said he was.
Essentially, heavy metal is a child of hard rock/heavy rock of the 70ies and that was in turn a child of the blues rock (they have that focus on riffs in common) boom of the late 60ies. The ingredients of Sunshine of your Love and Enter Sandman are not that different.
As I said: Whether girls dance to it gives you a pretty good clue!