The precise answer to that question depends to a large extent on storage conditions - refrigerate ham within two hours of cooking. To maximize the shelf life of cooked ham for safety and quality, refrigerate the ham in shallow airtight containers or wrap tightly with heavy-duty aluminum foil or plastic wrap. Properly stored, cooked ham will last for 3 to 4 days in the refrigerator. To further extend the shelf life of cooked ham, freeze it; freeze in covered airtight containers or heavy-duty freezer bags, or wrap tightly with heavy-duty aluminum foil or freezer wrap.