9mm is the diameter of the bullet, and 19mm is the length of the brass case, not the total length of the cartridge. The over all length of the cartridge will depend on the length of the bullet as there are different bullet weights (but the same diameter). Usually when someone says "9mm" they mean the 9mm Luger also known as the 9mm Parabellum. However this caliber comes in different bullet weights such as 115-gr., 124-gr., 140-gr, 147-gr., usually depending on whether it is a FMJ or a HP bullet.
Confused?
Well it gets better. The different 9mm that I came up with (and these are not usually interchangeable) are:
9mm Luger / Parabellum / 9x19 (same thing, 3 names)
9mm Browning Long
9mm Browning Short/9mm Kurtz/.380 ACP/9x17/9mm Corto/9 mm Kratak (same thing, 6 names)
9mm Bergman-Bayard / 9mm Largo (2 names)
9mm Glisenti
9mm Steyr
9x18mm Makarov (slightly larger diameter, .364" instead of .355")
9mm Ultra
9mm Winchester Magnum
.356 TSW
9mm Federal
9x23 Winchester
9x25 Dillon
.357 SIG (.40 cal. cartridge necked down to 9mm)
.38 Super
So as you can see, for the last century the 9mm (.355 caliber) has been very popular in automatic handguns.
Of course in revolvers the .38 Special is not a true .38 of an inch, it's .357 (just barely over 9mm) and of course lengthen the case and add a dash more powder and you have the .357 magnum.