What happens to the energy emitted by stars?

The cutoff between supernovae and red giants is about 8 solar masses. But very small stars won’t become red giants. They’ll just keep “burning” hydrogen to helium for a very long time (we’re talking over a trillion years) until they exhaust it. The reason it’ll take so long to exhaust is that, as eschereal points put, they are fully convective so they’ll consume almost all their hydrogen, not just the stuff in the core. The only hydrogen they recycle is through their stellar winds.

As for how long it takes for gas ejected from stars to cool enough, I’m not sure. Probably millions of years, but the exact time will depend on its initial temperature. And also how much it collides with other gas and dust.

yes