How to understand the lifespan of large-scale cosmological structures? When a star is said to live for 1 billion years, is that relative to the 'average cosmological time unit' or local time in the star's gravitational field? Also, if the sun is said to have 5 billion more years left in its lifetime, is that in cosmological time as well? 
I've been reading through some of the discussions on physicsSE about the age of the universe as I have always wondered what the time units for that actually meant. I now have the idea that it is calculated in a sort of average frame of reference avoiding strong gravitational fields. And so I'm wondering what the age of the universe would be as judged by an atomic clock carried by an observer moving around from star to star, observing each star for it's entire lifespan. Since time slows for that observer, would they measure a much shorter time than 14 billion years? What could be the maximum deviation? Maybe stars are never so massive as to change the measurement more than a few hundred million years.
Time slows down for an observer in a strong gravitational field. If an observer was born alongside a very massive star and lived a lifespan equal to the star's (1 billion years), would that observer then think 1 billion years has elapsed relative to their own reference frame (i.e. by using a local atomic clock) and a greater length of cosmological time would have elapsed?
For our sun, 5 billion years of cosmological time would actually be a shorter length as measured by a local atomic clock in the sun's gravitational field, yes? So if the sun is to last 5 billion more years, either (a) it is as measured by local time and hence is longer length in cosmological time, or (b) it is as measured by cosmological time and is a shorter length in local time. Am I thinking about this reasonably?
I'm sure you get so many non-experts asking silly/annoying questions on this site, so please forgive me as I'm a mathematician not a physicist but have studied some advanced physics topics formally. Mathematical and informal explanations are equally appreciated. 
 A: The geometry of the expanding universe is (approximately) described by the FLRW metric, and to express this there is a natural space/time split called comoving coordinates. The comoving time coordinate is roughly speaking the time measured by an observer who is at rest with respect to the cosmic microwave background. Since most galaxies have peculiar velocities that are small compared to the speed of light, we and any other alien intelligences out there approximately comoving observers.
The reason comoving time is such a useful coordinate is that all comoving observers will measure the same time to have elapsed since the Big Bang, so all of them will agree about the ages of stars etc. So when we say a star's life is a billion years we mean that a comoving observer will measure the stars life to be a billion years. Likewise all the other times that get mentioned in any conversation about cosmology.
If an observer is not at rest with respect to the cosmic microwave background then they will not measure the same time as comoving observers. Gnerally speaking, any elapsed times they measure will be shorter than those measured by a comoving observer.
A: To address the question of whether the age estimates are in years on Earth or years for a comoving observer in deep space, I could tell you the same thing John Rennie said. But that would make this redundant, unproductive, and redundant. Instead, let me show you that it doesn't really matter.
The equation for time dilation due to gravity is as follows:
$$t_0=t_f\sqrt{1-\frac{2GM}{rc^2}}$$
$t_0$ is the time elapsed in the dilated frame (near the massive object)
$t_f$ is the time elapsed in deep space away from gravity's influence
$M$ is the mass of the object
$r$ is the distance from it
$G$ and $c$ are the obvious constants.
Let's use this to figure out what the difference in elapsed time would be for us on Earth compared to a comoving observer in deep space over a period of, say, 1 billion years. We will need to take into account the effects of both Earth (at Earth's radius) and the Sun (at Earth's orbital radius). I'll ignore special relativistic time dilation because that will be extremely negligible (actually, as pointed out, it would accumulate to about the same order of magnitude as what I'm about to calculate. So multiply the numbers I get by 2 if you're a stickler that wants to include SR).
$$\begin{align}t_f-t_0=&t_f\left(1-\sqrt{1-\frac{2GM_S}{r_Sc^2}}\sqrt{1-\frac{2GM_E}{r_Ec^2}}\right)\\=&t_f\left(1-\sqrt{1-\frac{2G(1.99E30\,kg)}{(1.5E11\,m)c^2}}\sqrt{1-\frac{2G(5.97E24\,kg)}{(6.371E6\,m)c^2}}\right)\end{align}$$
Then we plug in a billion years for $t_f$, do some fancy calculator work and we find that the difference between an observer on Earth and one in deep space is about $10.5$ years. This means instead of experiencing $1,000,000,000$ years, on Earth we'd experience $999,999,989.5$ years.
So ask yourself, if they say the universe is $13.8\pm0.6$ billion years old or the Sun will become a red giant in approximately 5.4 billion years, do they mean Earth years or deep space years? Both. The difference caused by gravity in how we experience time relative to a comoving observer far from any gravitational source is negligible. We're talking $\pm144.9$ years for the age of the universe and $\pm56.7$ years for when the Sun goes red giant. That second one is less than a human lifespan. So it's safe to say that even if presented in comoving time (which it is), assuming that it's the same number of Earth years is fine.
Heck, even if we put Earth at the same distance around a star 1000 times more massive than the Sun in the above equation, you'll find that instead of $1,000,000,000$ years, you'd experience around $999,990,200$ years. Still well within the margin of error given that we only usually see ages over 1 billion reported to the nearest hundred million.
So when they say the Sun will turn into a red giant in about 5.4 billion years, you can safely assume that means Earth will go around the Sun about 5.4 billion more times before that happens.
