Here in the south of the USA we recommend heartworm prevention all year round, as we can have skeeters in December or January. In the northern states you may only need heartworm prevention for your dog late spring through late fall, as it is too cold for the rest of the year for mosquitoes to live and bite. However when you stop the preventative treatment during the colder months of the year, there may still be baby heartworms [microfilariae] in the blood stream that may not yet be killed - and those can continue to grow and mature during the "off" phase of your annual cycle. I would suggest if you are thinking about doing a partial treatment during the summer months only - to do more research and also to discuss this with your vet too, before making this decision.
Adult dogs must be heartworm free before getting on heartworm prevention, as killing off adult heartworms in large quantity can clog arteries and heart with dead worms, killing the dog in return. Advanced heartworm infestations will cause considerable damage to the heart and lungs - and must be treated by a veterinarian if you want to give your dog a chance to survive treatment. So unless your adult dog has been on heartworm prevention all of its life - or has been tested and is clear - it should be tested first.