How does the Earth's center produce heat?

Heating because of high pressure is mostly an issue in gases, where gravitational adiabatic compression can bring up the temperature a lot (e.g. in stellar cores). It is not really the source of geothermal heat.

Earth's interior is hot because of three main contributions:

1. "Primordial heat": energy left over from when the planet coalesced. The total binding energy of Earth is huge ($$2\cdot 10^{32}$$ J) and when the planetesimals that formed Earth collided and merged they had to convert their kinetic energy into heat. This contributes 5-30 TW of energy flow today.

2. "Differentiation heat": the original mix of Earth was likely relatively even, but heavy elements would tend to sink towards the core while lighter would float up towards the upper mantle. This releases potential energy.

3. "Radiogenic heat": The Earth contains a certain amount of radioactive elements that decay, heating up the interior. The ones that matter now are the ones that have half-lives comparable with the age of Earth and high enough concentrations; these are $$^{40}$$K, $$^{232}$$Th, $$^{235}$$U and $$^{238}$$U. The heat flow due to this is 15-41 TW.

Note that we know the total heat flow rather well, about 45 TW, but the relative strengths of the primordial and radiogenic heat are not well constrained.

The energy is slowly being depleted, although at a slow rate: the thermal conductivity and size of Earth make the heat flow out rather slowly. Geothermal energy plants may cool down crustal rocks locally at a faster rate, getting less efficient over time if they take too much heat. But it has no major effect on the whole system, which is far larger.

First things first: Human activity is not tapping into the heat of the Earth's core. At best, we're tapping into the heat differential between the surface and tens of meters to perhaps a few kilometers below the surface. Temperature in general increases with increasing depth. We humans don't have the technology to penetrate more than a few kilometers below the surface of the Earth, let alone the technology needed to penetrate the six thousand plus kilometers needed to reach the center of the Earth.

That said, the Earth's core does produce heat. It retains a bleep ton heat (read a crude four letter word instead of "bleep") from its initial formation. This initial heat came in two forms. One was a result of collisions. Even more heat was generated when the Earth separated into a core, mantle, and crust. This is where the bleep ton comes into play. The Earth has only had 4.5 billion years to radiate away that huge amount of heat. That's too short of a period of time for that huge amount of heat.

Regarding heat production, the Earth's core produces heat via the conversion of molten material in the Earth's molten outer core to solid material in the Earth's solid inner core. The Earth's core may also produce heat via radioactive decay of material within the Earth's core, but this is highly debatable. The four main long-lived radioactive isotopes (uranium 238 and 235, thorium 232, and potassium 40) are chemically incompatible with migration to the Earth's core. That heat is generated from the formation of the Earth's inner core is widely accepted. That heat is generated in the Earth's core via radioactive decay of uranium, thorium, or potassium in the Earth's core is anything but widely accepted.

We generally tend to underestimate sizes and masses of celestial bodies. A little giveaway is that for all non-astronomical means and purposes we consider the Earth's mass infinite without any measurable error.3

Let's make an estimation: How does the heat stored in the planet Earth relate to humanity's energy production? I'm only interested in an order of magnitude here. Let's assume that the average specific heat of the earth's matter is that of silica (SO2), ca. 0.7 J/(g*K). This leads to the following results:1

Specific heat of silica (J/(kg*K))              7.00E+2
Earth's mass (kg)                               5.97E+24(2)
Earth's energy/K, assuming it's all silica      4.18E+27

World primary energy supply 2015 (Mtoe)         1.36E+4
J/Mtoe                                          4.19E+16
World primary energy supply 2015 (J)            5.60E+20
--------------------------------------------------------
Years of world energy supply from ΔT=1K         7.31E+06
========================================================

That's actually less than I thought, by a factor of 100 or so, but still ... long.

It's noteworthy though that this estimate assumes a constant energy supply for the next couple million years. That is rather unlikely since we'll be on our way to a Kardashev Type III civilization, provided we manage to survive all the bottlenecks ahead. As Ray Kurzweil remarked we tend to underestimate exponential growth because we are hardwired for linear relations. A civilization with exponentially growing resource usage (like our current one) will not be able to rely on geothermal energy for geological time frames. (It will not be able to rely on solar energy either, if we extend the time frame just a bit.) If we assume an increase of 2% per year, Wolfram Alpha plots this nice curve which shows when the supply needed in a single year would amount to the Earth's thermal energy corresponding to a 1K difference. Apparently that point would be reached in 800 years, not 7 million. Note how the curve doesn't make a dent until year 500 or so.4

1 The original primary energy consumption number is from the IAEA. Mtoe stands for mega ton oil equivalent, roughly 4,187e+10 J.

(2) Give or take 10^20

3 Obligatory (but somewhat depressing) xkcd.

4 A similar curve (with a time interval of perhaps 150 years instead of 800) could be drawn for the consumption of mineral oil. In the mid-1800s anybody predicting that one day not too far into the future we'll worry about using up all of the easily accessible mineral oil of the Earth would have been laughed out of town.

It's entirely possible that I made a mistake and the result is off by a few decimal digits (although it's probably not too small); I appreciate corrections.