Grams and liters are units of mass and volume so conversion between the two requires more information about the substance. The relationship of mass divided by volume is known as density, and density varies between substances.
For example, a block of stone typically has more mass than a block of wood that is the same size, so the stone can be said to have greater density. Water is a convenient standard in the metric system, because it has a density that is very close to 1 gram per milliliter. If the substance in question is cold water, there are approximately 1,000 grams in a liter.