Until about a century ago, it was easy to say what a galaxy was. There was only one galaxy, the Galaxy, our Milky Way. The word galaxy comes from the Greek for 'milky'. The Galaxy was the whole of the heavens, what we now call the Universe.
Then twentieth-century telescopes showed that there were great star systems way beyond our Galaxy, so it couldn't be the whole cosmos. Today we know of billions of galaxies, and astronomers consider them to be the building blocks of the structure of the universe.
More than stars
The most obvious aspect of a galaxy is stars – lots of them. They're held together by their mutual gravitational attraction. But there's more to a galaxy than stars. Although stars have planets and moons, their mass is negligible. However the considerable amount of gas and dust between star systems makes an important contribution to the mass of many galaxies, and these nebulae are raw material for new star formation.
Galaxies also contain two surprising elements, black holes and dark matter. The Milky Way is one of many galaxies whose center has a supermassive black hole with a mass millions of times that of the Sun. Dark matter is dark in the sense that we can't see it, and in the sense that we don't know what it is. It seems to have a gravitational effect on other matter, but can't be detected by any kind of radiation.
Galaxies are varied and there are many ways to classify them. We still commonly use Edwin Hubble's system based on the one characteristic observable in his day: the shapes of galaxies in photographs. Most of them seemed to be either elliptical or spiral.
An ellipse is a stretched circle and Hubble classified the elliptical galaxies according to the amount of stretching. So E0 would be round and E7 nearly cigar-shaped.
A spiral galaxy has two main parts: a central bulge or central bar, and a disk with spiral arms radiating from the central mass. If the central mass is a bar, the galaxy is known as a barred spiral. You can see the difference between an ordinary spiral and a barred spiral in the Hubble tuning-fork diagram. (Its nickname refers to the shape of the diagram.) The diagram shows that the classes of spirals range from those with a large bulge/bar and tightly-wound spiral arms to those with open spiral arms.
The tuning-fork diagram also shows a third type of galaxy, the one labeled S0 where the fork joins the handle. This is a lenticular galaxy, and although there is a bulge and flattened disk, there's no spiral structure.
Finally, irregular galaxies form a fourth category, a catch-all for those that don't fit into the other three classes.
Elliptical galaxies look elliptical from any angle, and lack the complex structure of spiral galaxies. They have fairly even distributions of stars, though there is usually a core that is denser than the outlying regions. Sometimes we can see dusty areas, but these galaxies have quite a low proportion of dust and gas, so there's little or no new star formation. Furthermore they are commonly a yellowish color, showing that there hasn't been new star formation for a long time. Star color is related to temperature, with red the coolest, yellow hotter, then white and blue. Yellow stars are older stars. Hot young stars radiate in blue and white, so a blue area shows a star formation region.
Spiral galaxies have a good deal of structure and they look different in photos taken from different angles. This can make them difficult to classify. Different structures within the galaxies contain stars of different ages. The bulge/bar looks yellow, showing an older star population. But the spiral arms in the disk are outlined by enormous dust lanes and tend to be blue. The spiral arms are where stellar nurseries are located.
Giants and dwarfs
On a human scale all galaxies are unbelievably enormous, but there is considerable variation in size. The smallest ones are dwarf galaxies. They have different shapes, but none are spiral. The smaller ones have diameters of between 300-1600 light years across and masses between 10-100 million times the mass of the Sun. Most dwarfs have been discovered as companion galaxies to larger galaxies. The two best-known are the Large and Small Magellanic Clouds, satellites of the Milky Way.
The Milky Way is a giant spiral galaxy over 100,000 light years across with at least two hundred billion stars. Our neighbor Andromeda may have a trillion stars. But these aren’t the biggest galaxies we know. The biggest ones are the giant elliptical galaxies, probably formed from the merger of other large galaxies. In fact, in the distant future Andromeda and the Milky Way are expected to collide and produce such a giant.
Matter in the Universe isn't uniformly spread out. There are giant structures and voids essentially empty of matter. The structures are formed by galaxies. Galaxies tend to be in groups, e.g., the Milky Way and Andromeda are part of the Local Group. The groups are part of galaxy clusters, and superclusters contain more than one cluster.
Although the Universe is expanding, it hasn't grown much in the past century. However our concept of the universe has grown quite a lot from the idea of the Galaxy-as-universe to a Universe of billions of galaxies.