Many dogs experience hearing loss over their lifetime and the causes of deafness vary greatly. They could be related to some congenital disease or could be a simple result of old age. Also any type of middle or inner ear infections, head injuries, and even certain drugs and poisoning can cause deafness.
Antibiotics like Gentamicin and Neomycin are notorious for causing deafness. hypothyroidism is another possible cause of deafness as well.
Puppies are usually not old enough to respond to sound until day 11, so you cannot tell if a puppy has been born deaf until that time. Dogs that have a predominantly white coat are at increased risk for congenital deafness. The highest incidence seems to occur in Dalmatians but there are at least 30 other breeds affected.
Senile deafness is also known as old age deafness usually doesn't occur until the dog reaches at least 10 to 12 years of age and this type of deafness usually is not a total loss of hearing because the dog usually retains some ability to hear some high-pitched sounds like a dog whistle.
Some signs that your dog might be losing its hearing include being less active, and moving more slowly. Also the dog is much slower to respond to certain commands.
You can test your dogs hearing by going behind them and clapping your hands or stomping your foot to see if they respond. But remember just because they're deaf doesn't mean that they can't still feel vibrations through the floor as well so stopping your foot might not be the best test for them.