If the h is sounded and the first syllable is stressed, as in "hammer", we use "a".

If the h is normally sounded but the first syllable is not stressed, it could be either "a" or "an", depending on the noun and the speaker. I think you will hear "an historical building" more than "an harpoon". Words in this category may be pronounced differently by different people in different places. According to our esteemed moderator Nohat, traditionalists would use "an" in this case (see the link above).