As I understand it, about half the heat comes from radioactive decay - potassium-40 and uranium, mostly. The other half comes from gravitational potential energy being turned to heat as heavier stuff settles toward the middle, and from the heat of crystallization released as the liquid of the outer core crystallizes onto the inner core.
I don't know when it'll be down to lukewarm, and I'm not waiting around to find out...