Red giants and white dwarfs are different stages in the life of a star. After a star has used up all its fuel, it can expand into a red giant, growing ever larger and casting off its outer shell. Then the star’s center contracts to form a small but extremely dense and intensely hot white dwarf. This will happen to our own sun in about 5 billion years or so.
The question of the life span of a star hinges on the star’s mass. A star that is about the size of our sun (which, incidentally, is only an ordinary star despite the 6 billion people to whom it gives life) takes about 50 million years to reach maturity.
Size or mass matters where stars are concerned. Stars that are actually larger and brighter than our sun burn out much faster.