The first way to tell the difference is a matter of “resolution” — seeing fine detail. Telescopes can easily resolve clusters, whether ragged open clusters or dense globular clusters, within the Milky Way, but they can’t do so with most other galaxies. In cases where we can resolve other galaxies, we see vast numbers of stars, usually far more than are contained in simple clusters. In cases where we cannot resolve the stars, galaxies sometimes give themselves away by their structures, which are different from those of clusters (although a rich globular can look similar to dwarf galaxies). Most telling is that, aside from a few local ones, galaxies exhibit large shifts toward the red end of their light spectra, which reveal that they are receding from us at high speeds due to cosmic expansion, whereas clusters in the Milky Way do not.
Up until the 1920s, this distinction was not clear, and many astronomers believed that the fuzzy blobs we now know to be galaxies were stellar groups within our galaxy. The distinction was finally obvious when Edwin Hubble resolved the Andromeda Galaxy into distinct stars and found the distance to some, showing that the galaxy had to be far away and a separate system from the Milky Way. — Jim Kaler, University of Illinois, Urbana-Champaign
Up until the 1920s, this distinction was not clear, and many astronomers believed that the fuzzy blobs we now know to be galaxies were stellar groups within our galaxy. The distinction was finally obvious when Edwin Hubble resolved the Andromeda Galaxy into distinct stars and found the distance to some, showing that the galaxy had to be far away and a separate system from the Milky Way. — Jim Kaler, University of Illinois, Urbana-Champaign