Depend of the country, in France it's to the center of the earth, which means you receive some money when they build a metro under your house becaude they buy a right to use part of your property.
Iceland invaded by French Marines; geothermal energy in magma was "not theirs to take", says Macron"
In UK I'm pretty sure it's nothing, certainly you don't get anything (money/rights) if oil or coal is extracted from beneath your property ... but then people are allowed - with planning permission - to build down from established property. I expect the Crown owns it all.