An opened bottle of ketchup can be stored in the refrigerator for one to six months without changes to color or texture. Obviously, if it smells or looks rancid or "off", it should be discarded. But because ketchup is so high in acidity, it keeps quite well.
Unopened bottles may be kept in the pantry. Most bottles are marked with a sell-by date that is 15 months after production.
Check out Cooking Light's ketchup recommendations in Taste Test: Our Favorite Ketchups.