Believe it or not, there actually is a slight difference between the two:
He can have the hammer. (He has the necessary permission to possess the hammer.)
Some people consider this wrong and that the correct word is may, but in contemporary English, using can have signifies permission over ability, because the cases where someone is unable to possess something are very few and far between. This is not necessarily true in other cases—"You can go the bathroom", as drilled in by so many teachers, does express ability.
He could have the hammer. (He has the potential to have the hammer already in his possession.)
The speaker does not know who has the hammer, but he has the potential to have it.
If I take the large box, he can/could have the hammer lying underneath it.
This is one of the few cases I mentioned above where he might not actually be able to possess the hammer. In this case, can signifies ability, because presumably, the box is on top of the hammer, thus not allowing him to reach it. Even here, there is a slight difference—using the word could over can could, depending on the audience, sound either formal or reluctant.