How long swollen gums will last depends on the cause. If you have gingivitis, it might take a couple of weeks of consistent oral hygiene for you to start seeing relief from swollen gums.
If you’ve had an infection, swelling should start to go down in the days after you start treatment. If you’ve had a dental procedure or injury to the gums, you should expect to see swelling go down after a day or two, and then completely subside within 1-2 weeks. In either case, if the swelling persists or gets worse instead of better, it’s a good idea to ask your dentist for advice.
Swollen gums are no fun. More often than not, it's something you can take care of on your own. Once you find out what's causing your swollen gums, you can begin to treat it. Just make sure to talk with your dental professional if it's a chronic issue that's not getting better.