It is not possible to have a zit on your gums or your mouth.
This is a mouth ulcer you have but it has the appearance of a zit and is also very sore.
Mouth ulcers occurs in many ways.
You can accidently bite the inside of your gums or cheeks which can cause an ulcer.
It's very unlikely that you would have a zit on your gums. A zit, acne, is caused by pores with trapped dirt, bacteria, oils. It is probably a cold sore. With a white center it could be confused with a pimple.