Well, if you smoke, then this is probably the cause of it. I learned this at some drug program, I think you might have some sort of cancer. D: Well, that's what you get for smoking. (If you do not smoke, then completely ignore my answer).
if it is swollen around a tooth area I would floss, if it is more like a little pimple it is an abscess/infection, it will "pop" on it's own or reabsorbs, if the gum breaks clean it with a q-tip and hydrogen peroxide. If it does not resolve soon you should see a dentist, the infection could affect your teeth and cause a cavity or worse