Gastritis is a term almost synonymous with upper abdominal pain although they actually do carry different meanings. Gastritis is a tissue level diagnosis indicating inflammation of the stomach lining which may or may not manifest as pain or discomfort. Mild gastritis is very common and does not require treatment if asymptomatic.
Depending on the underlying cause of gastritis, this inflammation can exist over a different time period. Symptomatic gastritis may persist until the underlying cause such as Helicobacter pylori infection or the excessive use of strong pain killer has been addressed. If the upper abdominal discomfort is not related to severe gastritis or ulcers, a short course of acid suppression therapy may just do the trick.
However, if the symptoms recur or persist over a period, it will be more prudent to seek medical help early so as not to miss important medical conditions such as gastric ulcers or growth. At times, gallstone related pain is wrongly ignored as "gastritis" for a long time and only to be discovered when complications occur.