The OED defines ham as:
The thigh of a slaughtered animal, used for food; spec. that of a hog salted and dried in smoke or otherwise; also, the meat so prepared.
It defines gammon as:
The bottom piece of a side or flitch of bacon, including the hind leg. In later use also: a smoked or cured ham.
It defines bacon as:
The back and sides of the pig, ‘cured’ by salting, drying, etc. Formerly also the fresh flesh now called pork.
In Britain there is a street-wisdom about when to describe meat as ham, as bacon or gammon. Ham is usually bought ready-cooked. Gammon usually comes as a joint, bacon in slices.
But is there a clear distinction which is not being picked up here?