Converting between grams and cups depends on the ingredient that you are using. Cups measure a certain volume of material whereas grams measure a weight. To convert a recipe from cups to grams, you need to use a conversion chart or use scales and note down the quantities.
There is no way to convert easily between a volume and a weight without having some information about the ingredient being converted. For example, a cup of wheat flour that has not been sifted weighs 120 grams, but the same flour sifted weighs 110 grams due to the extra air it contains, which gives it a bigger volume.
This is also true for liquid ingredients by volume. A cup of oil has a different weight in grams to a cup of water. It is important to note also that different countries have different cups sizes. An American cup size is 240 milliliters, whereas an Australian, South African and Canadian cup is slightly bigger at 250 milliliters. If you do not have access to the cup size that your recipe calls for, you can still make it with the cup measure that you do have as this ensures that all proportions are the same.