G = Universal Gravitational constant. It's value is always constant for the whole Universe.
g = Acceleration due to gravity. It's value may vary with height and the planets.
G is constant for always in universe but g can vary. g is gravitational force on freely falling body and G is the force of attraction between two object having mass m and separated at a distance.