A dog should be given heartworm treatments at least once per month.
Heartworms are contracted by mosquito's biting your dog so if your dog gets bit by mosquitoes then you should get them treated for heartworms.
I believe though that you have to go take the dog to a vet to get a prescription for heartworm medication for your dog so you'll have to see your dogs vet.