Store-bought ham can often be overly salty. However, submerging the meat completely in a large bowl of cold water and refrigerating the whole setup for four to 12 hours can help.
Ham is made by dry curing or dipping the meat in brining solutions, which contain salt and other ingredients. The large amount of salt used in the process is what makes ham salty.
The water bath works by washing away salt on the surface of the ham. Plus, the lengthy soak time allows any salt inside the ham to leach out and get into the surrounding water.
That is why it helps to replace the soaking water every few hours. When you do so, you get fresh batches of cold water that have more capacity to draw out the salt from the meat.
Once done, pat your ham dry with paper towels and cook it as usual. Note that the saltier the ham is, the more time it'll need to soak in water to have its saltiness reduced.