The dimensions of a cartridge are set by the inventor. Generally the inventor is a cartridge/gun manufacturer. .44 Smith and Wesson special. .44 Remington Magnum. .45 Colt (commonly but incorrectly called the Long Colt). The numeral designation may or may not have anything to do with the bullet diameter.
The .38 Smith and Wesson special was invented many years ago and .38 "sounded" good even though the bullet was .358 diameter. When the .38 special was elongated and made more powerful, it was called the .357 Magnum even though it, too used .358 diameter bullets. The .357 referred to the groove diameter of the barrel.
When naming cartridges, sometimes the groove diameter is used, sometimes the land diameter is used. The groove diameter is generally .001" larger than the land diameter.
Sometimes the name is a play on the designation of an earlier cartridge. The .38 Super is a hot loaded .38 ACP. The external dimensions are the same, but the pressures are very different.
The .38 Short Colt used a bullet with a .374-.375" diameter in an arrangement similar to a .22 LR (the bullet is the same diameter as the case, called outside lubricatred). This was lengthened and called the .38 Long Colt that used a .358 diameter bullet enclosed in the case (called inside lubricated). The narrowing of the bullet diameter was a result of putting the bullet inside the case. This was again lengthened and called the .38 special even though it still used the .358 diameter bullet. The .38 spl was lengthened and called the .357 Magnum. This was a more accurate representation of diameter but the older, shorter cartridges could still be fired in a revolver chambered in .357. Of course the .357 Maximum came out which took the Magnum term to a never seen before level.
The .44-40 was a .44 caliber cartridge with 40 grains of black powder. It did not actually use a .44 diameter bullet, it used a .427 bullet. The .44 special used a larger .429 bullet but still was not a .44. The .44 Magnum was a lengthed .44 Special and still used a .429 bullet.
To confuse things even more the .38-40 did not use anything close to a .38 caliber bullet, it used a .401 or .40 caliber bullet. It probably played on the public's recognition of the .38 name.
Metric designations generally refer to bullet diameter X case length, both in millimeters. 9 X 19, 5.56 X 45, 7.62 X 39, 7.62 X 51 etc.
Europeans will throw an "R" at the end to identify it as a rimmed cartridge. Some "R" cartridges have rimless sisters. 7 X 57R is the rimmed version of the 7 X 57 (7mm Mauser).
This could go on for days as there are more exceptions than there are rules.