What causes recurrent painful sores on my gums and inner cheeks?

How to get rid of recurrent, foul-smelling sores on my gums and inner cheeks?