Depending on your condition or the reason you're taking omeprazole, you may only need it for a few weeks or months. Sometimes, you might need to take it for longer, even for many years.