If you have ulcers caused by H. pylori, you’ll need treatment to kill the germs, heal your stomach lining, and keep the sores from coming back. It usually takes 1 to 2 weeks of treatment to get better. Your doctor will probably tell you to take a few different types of drugs.