Ham can last six to eight months when it is stored in the freezer, whether it is uncooked or cooked. Ham needs to be put in the freezer before the use-by date on the packaging for it to last that long, or it must be immediately frozen after being cooked.
Proper packaging helps frozen ham to stay fresh for the longest possible time. The ham should be stored in a tightly closed container that can keep out moisture and contaminants, which can cause the ham to go bad sooner. The container used to store the ham should also be freezer-safe.