This answer will be aimed at the US.
Why does on various images, such as below, have 1200' and 700' AGL for
Class G Airspace?
The "1200' AGL" and "700' AGL" labels are simply stating the altitude where the figure is intending to show that the Class G airspace ends and the Class E airspace begins, at different locations.
Note that it is very common one for of these two altitudes to be used for the floor of Class E airspace (and therefore the ceiling of the underlying Class G airspace), and a specific symbol is dedicated to each of these two cases on VFR sectional charts.
But if--as you suggested in comments-- you were asking what criteria is used for deciding which of these altitudes should be used for the floor of any particular Class E airspace (and therefore the ceiling of the underlying Class G airspace), read on--
In the US, airspace designers follow the guidance in a FAA document called "Procedures for Handling Airspace Matters" (see link here).
On page 18-2-1, we read the following:
18−2−2. 700/1,200−FOOT CLASS E AIRSPACE
Class E−5 700/1200−foot airspace areas are used for transitioning
aircraft to/from the terminal or en route environment.
18−2−3. 700−FOOT CLASS E AIRSPACE
A Class E−5 airspace area with a base of 700 feet above the surface
must be designated to accommodate arriving IFR operations below 1,500
feet above the surface and departing IFR operations until they reach
1,200 feet above the surface.
18−2−4. 1,200−FOOT CLASS E AIRSPACE
Where sufficient controlled airspace does not exist, designate a 1,200
foot Class E−5 airspace area to accommodate arriving IFR operations at
1,500 feet and higher above the surface and departing IFR operations
from the point they reach 1,200 feet above the surface until reaching
overlying or adjacent controlled airspace.
18−2−5. CLASS E AIRSPACE FLOORS ABOVE 1,200 FEET
Class E−5 airspace areas may be established with MSL floors above
1,200 feet AGL. Normally floors will be at least 300 feet below the
minimum IFR altitude.
So, a Class E floor of 700' AGL rather than 1200' AGL will be set in areas where arriving IFR traffic is expected to be operating below 1500' AGL or departing IFR traffic is expected to be operating below 1200' AGL, unless the airspace is protected by some higher level of protection, such as Class B, C, or D airspace, or Class E airspace extending all the way down to the surface.
Sections 18-3-1 through 18-3-6 go into much more detail on how these Class E floors should be set to match the expected paths of departing and arriving IFR traffic.
Interestingly, the "Procedures for Handling Airspace Matters" document is rather vague on what criteria should be used to designate areas where the floor of Class E airspace comes all the way down to the surface. The answer lies in part in section 17-2-7 (d) on page 17-2-2, but this only addresses surface-level Class E "extensions" to Class D or higher airspace, not situations like at KSHR or KONP, where a circle (or other shape) of surface-level Class E airspace has been designated to protect an airport that entirely lacks any Class D (or higher) airspace. The latter situation is addressed in sections 18-1-2 and 18-1-3 on pages 18-1-1 and 18-1-2, but the criteria given are much less specific than the ones that were given for setting Class E floors at 700' AGL or 1200' AGL.