Why didn't the center of the earth cool after millions or billions of years? What keeps it hot?
There is a nice article from Scientific American, but the main point is:
There are three main sources of heat in the deep earth: (1) heat from when the planet formed and accreted, which has not yet been lost; (2) frictional heating, caused by denser core material sinking to the center of the planet; and (3) heat from the decay of radioactive elements.
Other planets may have more or less radioactive material and this will make a difference over time as to whether they continue to have a molten core, or become volcanically and tectonically inactive.
From a simplistic point of view the rate of cooling depends on the ratio of surface area to volume. It is complicated by the rate of heat transfer of various layers, and internal sources of "new" heat in addition to the heat generated when the planet formed. The main way heat is lost is radiation to space. The atmosphere itself acts a a kind of "blanket" to sow the radiation loss(de Pater and Lissauer, Planetary Sciences)