Unfortunately, the answer to this question is it depends. It depends on the year, where you live, your environment, and, for fleas it depends on how big the flea problem has been for you in the past.
Heart worms first. Outside air temperatures have to be over 67° for two weeks in order for mosquitoes to transmit heart worms. If you live where temperatures get cooler than that during the winter you do not need to give heartworm prevention during that time.
Now fleas. The tough thing about fleas is they know how to avoid winter and to hide. In years when the winter is especially mild, the fleas can show up at any time. Good hard winters will kill a lot of them off and your need to medicate will be a lot less. But if you live somewhere where you have a ton of neighbors and a lot of stray animals then you may still have a flea issue.
It used to be that the rule was once we got a good hard frost you did not need to give flea prevention through the rest of the winter. People living closer together and having more animals have changed this rule. These days, when temperatures finally get to where there is a hard frost, we still need to evaluate how the rest of the winter going when deciding whether not to use flea medication. Two years ago I had many clients who were still finding fleas in the middle of the winter. This winter, most of my clients are not finding issues as the winter is hard enough.