Unfortunately, there is not a rule set in stone for everyone and also it all can depend on your neighbors and your apartment rules.
Many places have a rule or noise ordinance of 11 PM to 7 AM where you must keep a lower volume so people can sleep. But is this really fair for the people who work at night and the only time they can vacuum is late at night?
When it comes to vacuuming and really any loud noises I like to do it before 9 PM or after 9 AM; I feel this is a good time for everyone.
But everyone (or at least you hope they do) clean their home often, and there will be noise that will come from that. I would be more worried if my neighbors didn’t clean so often, the more they clean, the less chance of bugs.
There is no set rules, but you can talk to your neighbors and tell them your situation and see if the vacuuming late or early is even a big deal to them. Sometimes people think the littlest things are big problems when your neighbor really might not care at all. So just talk to them.
How To Clean Carpet Quietly
If you must vacuum at odd hours why not consider a quiet vacuum cleaner. I’ll be honest, even the quietest of vacuum cleaners can be loud when it’s 2 AM.
But quiet Vacuum Cleaners do exist, and most are super effective at cleaning too!
I have an interesting post about quiet vacuum cleaners here that explains where you can get them.
If you want to be the quietest, you can use a Carpet Rake like this one to loosen up the fibers of the carpet to free the crumbs and hairs and then sweep them up or use a Floor Sweeper like this one here. These will still make noise as it is not possible to make no noise but will be quieter then powering up a big powerful vacuum cleaner. Please keep in mind that a floor sweeper is not a substitute for vacuuming but works well for in between vacuum cleanings.
I don’t recommend doing this, but I’ve seen many shop guys build silencers for their shop vacuums. I thought they’re a pretty neat idea. It seems a little cumbersome for apartment use or even home use, but still an interesting idea.