Jupiters moon Io is heated through the gravitational pull of Jupiter, but when Io is heated because of this, where does that energy come from? How does conservation of energy work for this effect, where is energy "lost"?
TL;DR: The energy ultimately comes from Jupiter's rotation.
Io is tidally locked; it has the same orbital and rotation rates. If Io was in a circular orbit, the tidal forces on Io would merely result in a "frozen tide" on Io. There would be no heating because Io's shape would not be changing. However, Io's orbit is not quite circular. This means the tidal forces vary in magnitude and direction over the span of an orbit. This stretches and squeezes Io, which in turn results in Io's heating.
There's a tension between the other Galilean moons, particularly Europa, and Jupiter with regard to Io's orbit. If those other moons didn't exist, the dissipation of those tidal forces on Io would tend to circularize Io's orbit. The outer Galilean moons tend to make Io's orbit more elliptical. Which wins of Jupiter's tendency to make the orbit more circular or the outer moons to make the orbit more elliptical depends on two things: the ellipticity of Io's orbit, and how warm Io's interior is.
The degree to which Io responds to the Jovian tidal forces depends on the ratio of Io's $k_2$ Love number to its tidal dissipation quality factor $Q$. The quality factor is high when Io is cool, low when Io is hot. Io cools as it's orbit becomes closer circular. The outer moons can then push Io into a more elliptical orbit, and that's when Io warms up. Now the Jovian influences dominate, and Io moves toward a more circular orbit. Heating and cooling a large moon takes some time, so this means there's a time lag in the response. A nice hysteresis loop sets up.
These tidal effects go both ways. Io raises tides on Jupiter. How Jupiter responds to those tidal forces depends on the ratio of Jupiter's $k_2$ Love number to its tidal dissipation quality factor $Q$. Various estimates of Jupiter's quality factor $Q$ were extremely high before humanity sent spacecraft to Jupiter. Now that we've accurately seen the Galilean moons in action for quite some time, it appears that Jupiter's $Q$ is rather low.
There's a lot of dissipation in the Jovian system. The energy certainly has a place to go. As for where it comes from, that's simple. The actions by Io on Jupiter slows Jupiter's rotation rate. This is the ultimate source of energy for the Galilean system.
Note that Lainey et al. disagree markedly with Wu on the value of Jupiter's Q, 36, 000 (Lainey et al.) to 109 (Wu).