g is the acceleration due to gravity produced by a particular body such as the Earth. It is a variable: g=r2GM depends on the mass of the body and on the distance from its centre, so it decreases with height and with depth. Its value at the Earth's surface is about 9.8m s−2, and it is a vector.
G is the universal gravitational constant in F=r2Gm1m2. It is a scalar constant, the same for all bodies everywhere: G=6.67×10−11N m2kg−2.