It has to do with how the cartridge is ignited in the firearm.
In modern ammunition (as opposed to blackpowder), cartridges are ignited by means of a primer.
Centerfire cartridges have a primer in the center of the base of the cartridge. If you look at a 9mm, .38 Special, .357 Mag, .45ACP, .30-06, or 20 gauge (just as examples), all will have a smaller, center circle. That's the primer. It is struck by the firing pin which ignites the primer, which in turn fires off the powder load, propelling the projectile down the barrel.
Rimfire cartridges have a priming compound that is internal - you can't see it from outside the case like the examples above. The primer will strike the rim of the cartridge where the compound is compressed inside the cartridge. The process continues as above.
Generally, the only "modern" rimfire anylonger is the .22 - short, long, long rifle and Magnum - and the .17 Rimfires.
There were some rimfires in the late 1800s, but as far as I know, most - if not all - are obsolete as far as modern loads go.
If you want to know, look at the base of the cartridge. If you see a small circle, it's centerfire. If it's flat, it's rimfire.
Q