A gram (g) is a unit of weight in the International System of Units (SI).
The kilogram (kg) is the base unit of mass/weight in SI. The "kilo" prefix attached to gram indicates 1000 or 103 grams, so it follows that:
1 gram = kilograms
1 kilogram = 1000 grams
In the past, the gram was a base unit in the centimetre-gram-second (CGS) system of units, which was a system of measurement defined around the base units it was named after: centimetres, grams, and seconds. In this system, the gram was defined as "the absolute weight of a volume of pure water equal to the cube of the hundredth part of a metre, and at the temperature of melting ice." This definition of the gram is no longer used. Now a gram is mostly used as its definition relative to the kilogram (10-3 kg), as mentioned above.
Below are some other equivalences between the gram and other common measurements of mass/weight:
1,000,000 grams = 1 metric ton
28.349523125 grams = 1 ounce
453.5924 grams = 1 pound
Pounds and ounces are units of mass/weight commonly used in the US customary and imperial systems of measurement. The values referenced here specifically refer to their definitions within the avoirdupois system of measurement.
Grams and SI Prefixes
Even though the kilogram, not the gram, is the SI base unit of mass, SI prefixes are used to modify the gram, not the kilogram. This is unique to the kilogram because SI units cannot have more than one prefix, and the kilogram is the only base unit in SI that already has a prefix: kilo.
As a result, while a "milli" prefix applied to any other SI base unit, such as the second, would mean that 1 millisecond is 10-3 seconds, 1 milligram is actually 10-6 kilograms, since the gram is the reference unit, not the kilogram.