VATS works off of Action Points, or AP. You can see your max AP in your Pip-Boy, along the bottom of the Status screen. The exact formula for AP is 60 + (AGL * 10), so a character with 1 Agility will only have 70 AP, and a character with 10 Agility will have 160 AP.
Now, when queuing up actions in VATS, each shot uses a specific number of AP, as determined by the weapon and any mods added to the weapon. If you click on a body part to get the [ ] around that part, then look in the lower right corner of the screen, you'll see your AP bar, and a red line on top of it that indicates how many AP will be used to actually fire that shot. If you queue up another shot, another line will appear, etc. This continues every time you queue another shot until you run out of AP.
At this point, you hit whatever button your platform has mapped to execute the attacks you've queued up. At this point, each shot is fired, and each time a shot is fired, some of your AP is used up. Once all shots have been fired, or your target is dead, VATS ends. At this point, you're returned to real-time, but the total AP you spend is deducted from your AP pool. You can enter VATS again immediately, and if you've got sufficient AP, you can even fire shots, but because you used some AP in the previous VATS sequence, you can't fire as many shots as before. Thankfully, AP regenerates naturally; you don't have to use items to restore them like you do with Health. So if you give it enough time, your AP will get back to full, and you can fire off a full sequence of shots again.
The catch, though, is that AP takes time to regenerate. In previous games, it took about 17 seconds to go from 0 AP to full, regardless of how many AP you actually had. I don't know if this has remained unchanged from previous games, or if it's changed, but the overall point is the same: it takes time to recover AP, so you can't simply VATS your way through an entire fight. There are two exceptions to this: the Grim Reaper's Sprint perk (requires LCK 8) and a weapon with the Relentless Legendary Effect (such as Kellogg's Pistol). Grim Reaper's Sprint gives up to a 35% chance to recover all AP when you get a kill in VATS, while the Relentless effect always restores all AP when performing a Critical Hit. In either case, all AP gets refilled when the effect triggers, and you can immediately go back into VATS and get another full sequence off.