It can't occur when your game is off. They'll only attack when you're actually in the town. Unfortunately though, there's really no way to stop them. If you get lucky enough they'll spawn close to you and you can kill them before they slaughter your people. But most of the time they'll kill some of your NPCs before you have a chance to even get close to them.
If you don't want your towns to be barren, this DLC is probably not for you.
There are ways to fight them more efficently. Like don't fast travel into a city/town (better to fast travel to something close to a city/town and walk to said city/town from there). If it's dark, or even light, you should wait a few minutes outside the gate or enterence of a town before going in. Try to catch the vampires during the day.
I'm sure there are other ways to make it so you would only get a minimum loss of NPC's. In fact, someone on these forums posted a guide in helping you combat this vampire menace.
Does anyone have a link to said guide?