The thing you are able to palpate is a lymphnode. It comes and goes when when it becomes active and inactive due to infection. The exact place of the infection in your mouth has to be searched if it is not obivious. Many a time a sub clinical infection will produce like that feature. You need not be afraid but if it happens frequently please get checked for carries tooth or Tuberculosis
etc(list is long).
Hope you find my suggestion useful. Feel free to ask any further questions.