Answer:
Bacteria and mold do not grow well in the jam because jam acts as a hypertonic environment for the bacterial cell which causes water loss from the bacterial cell.
Jam has a very high concentration of solute in the form of sugar so when any bacteria or mold attacks on jam then due to its higher concentration of solute outside the cell the bacterial cell loses water from inside to outside which causes shrinkage of cell and ultimately resist the bacteria to grow.
Therefore the high concentration of sugar in jam do not allow bacteria to grow so it can be left unrefrigerated for a long time without contamination by microorganisms.