That's true, our sun is actually a small one.
I'd say they estimated it on many measurings. It's like this:
"The sun has 100 EJ of energy left, that's what we can say by its size and density of molecules. In 24 earthly hours it spends about 1 EJ on nuclear reactions. Let's say it will stay intact for about 90 days and in the last 10 days it will turn into a 'red giant'."
Of course, 100 EJ is nothing for our sun.
It's not like they say "The sun will vanish in 5168219417 years, 283 days, 2 hours, 51 minutes and 11,451 seconds".