If we define the start of the lifetime the protostar and the end of the lifetime a red giant (at max volume), what conditions would make this time the longest when the star was first formed and throughout it's lifetime. And I don't mean conditions that are never likely to happen within the universe.
2 Answers
The dominant factor determining the lifetime of a star is its mass. Most of a star's life is spent on the hydrogen-burning main sequence phase. Subsequent phases (subgiant, red giant, horizontal branch, asymptotic red giant) are much shorter, and the time between the first gas cloud collapse and the commencement of main sequence burning is much, much shorter.
Stars appear to be born with a broad range of masses in all regions of the universe. In fact, it is a struggle to find any strong observational evidence that the so-called "initial mass function" is anything but universal and invariant (e.g. Bastian et al. 2010). It is possible and theoretically plausible that the very first stars, born with no heavy elements, were predominantly very massive, but these would have had very short lives and are not around now.
Both the lifetime of a star before it reaches the main sequence (i.e. before it starts it's hydrogen burning career) and it's subsequent main sequence lifetime, are longer for lower mass objects. Roughly speaking, the main sequence lifetime is $$\tau_{\rm MS} \sim 10^{10}\left(\frac{M}{M_{\odot}}\right)^{-2.5}\ {\rm years},$$ where $M$ is the mass of a star in solar units.
Given that the universe is about 13.7 Gyr old and that the formation of stars began a few hundred Myr after that, then the oldest stars that are still on the main sequence have masses of $0.08 < M/M_{\odot} < 0.9$. The reason for the lower limit is that below this mass, the objects do not fuse hydrogen and are called brown dwarfs rather than stars. Slightly higher mass stars with same old age will now be red giants. Even higher mass stars will have completed their lives, but will have left behind stellar remnants such as white dwarfs and neutron stars.
So I think the answer to your question is that stars with a range of masses were born within a few hundred million years of the big bang and are still alive now.
If however your question is what kind of star will live the longest into the future, then the answer is the lowest mass object that can still be classified as a star. This is generally taken to be about $0.075M_{\odot}$ for objects with the same composition as the Sun, and about $0.08M_{\odot}$ for low metallicity objects that are more likely to be formed shortly after the big bang.
There appear to be no special conditions required to produce these very low mass stars and they are found basically everywhere that star formation has occurred.
The biggest factor that affects the lifetime of a star is its mass: the more massive it is, the faster it reaches the red giant stage.
So the condition that makes this the longest is very similar to asking what the lowest possible mass of a star is. The current observational limit is about 0.09 solar masses.
-
$\begingroup$ Doesn't the reduced mass make it reach denser elements more quickly than usual? Also what conditions would produce a star of low mass? $\endgroup$– yoloCommented Sep 2, 2019 at 1:51
-
1$\begingroup$ Are you familiar with stellar formation? If not I'd suggest reading the Wikipedia article on the topic. If yes, I think I won't be able to answer this question at the level you want. $\endgroup$– AllureCommented Sep 2, 2019 at 2:35