This is an interesting question, because most of the time when we talk about the lifetime of a star, we mean the part before the creation of a white dwarf or a neutron star. Typically, a star has a “lifetime” when it is burning hydrogen into helium, gradually consuming its central reservoir of hydrogen, producing light as it does so.
It’s using this kind of definition for “lifetime” that we say our home star Sol is middle aged. Our Sun is a little over 4.5 billion years old, about halfway through its estimated ~9 billion years of hydrogen burning. Once hydrogen burning is complete, our Sun, along with all other stars of its mass, will go through an elaborate end-of-life transformation, which involves shedding most of the outer layers of the star. In the case of the Sun, we’ll produce a planetary nebula out of the discarded outer surface of the star, leaving only the hot nucleus of the star behind as a white dwarf.
If the star were a bit larger, it would explode as a supernova instead of creating a planetary nebula and white dwarf. The star has to sit within a very specific range of masses in order to create a neutron star - too large, and the gravitational weight of the star can compress the core of the star down into a black hole, instead of stopping at a neutron star. If the star is too light, it won’t supernova at all, and you’re left with a white dwarf instead of a neutron star.
Whether you have a white dwarf or a neutron star, both are considered stellar remnants. They’re what remains of a star, after fusion has stopped in the core of the star, and gravity has dealt with the unstable star. Neither the white dwarf or the neutron star will be generating any new heat in their cores, or will be able to do much else, beyond sit there, without some kind of external influence.
A white dwarf, on its own, will sit in place and glow, gradually losing energy to the deep dark of space, until the white dwarf has lost enough heat to match the background temperature of the universe, at about 3 degrees Kelvin. If the white dwarf could achieve this, we would call the resulting object a black dwarf, but so far, none have ever been observed. This lack of black dwarfs isn't a surprise - the amount of time a white dwarf is predicted to need in order to get to black dwarf status is longer than the Universe has been around. There quite literally hasn’t been enough time in the entire universe for a white dwarf to cool.
Neutron stars are also high temperature objects, and all they can do is cool, but they come equipped with frankly astoundingly strong magnetic fields, and so their cooling process is a little more involved. We spot many neutron stars in the night skies by watching them beam X-rays away from themselves. Combined with the extremely rapid rotation that a lot of neutron stars have, neutron stars are often picked out by watching them pulse in brightness, like a high energy radiation lighthouse.
Without some kind of external factor coming into play, neither a white dwarf or a neutron star will cease to exist in our universe, so in that regard a neutron star and a white dwarf are tied for longevity. There are external factors you could invoke to dispose of a white dwarf or a neutron star - these usually come by way of a second star, which donates mass to the white dwarf or to the neutron star. If the white dwarf gains enough material from devouring its neighbor star, it can explode in a supernova, detonating itself into oblivion. A neutron star can also gather enough mass to itself so that it collapses into a black hole, imploding inwards on itself. However, there's no reason for the white dwarf to always do this faster than a neutron star, because the key factor here is how quickly the star can steal material from its companion. The speed of the theft depends on the orbit of the companion, not whether or not you have a white dwarf instead of a neutron star.
Without such a stellar donor, both of these stellar remnants will simply hang out in the Universe, slowly losing their heat, until they have matched the background temperature of the Universe.
Sign up for the mailing list for updates & news straight to your inbox!