If you've accidentally sucked a spider into your vacuum cleaner and you want to ensure it's dead, there's no specific amount of time you need to keep the vacuum cleaner turned on. Spiders are relatively fragile creatures, and the suction of a vacuum cleaner is usually enough to kill them. Once they are inside the vacuum's dust collection bag or canister, they will have a limited supply of oxygen, which further reduces their chances of survival.
If you want to be extra cautious, you can leave the vacuum cleaner running for a few minutes after you believe the spider has been sucked in. However, it's important to note that most spiders are harmless to humans, and the vast majority of them will not pose any threat. If you're concerned about a potentially dangerous spider, it's better to capture it using a humane method and release it outside.
Ultimately, keeping the vacuum cleaner running for a short time after encountering a spider should be sufficient to ensure it's not a threat anymore, but it's always a good idea to practice caution and use other methods to remove or eliminate spiders if you are uncomfortable dealing with them.