Hydrogen, helium and other light elements formed with the Big Bang, but the heavy elements were cooked up at various times in an 8 billion year span before our solar system was formed, and some, perhaps, are still cooking.
Earth's own time as a life-supporting planet is maybe 3 billion years. Nobody really knows how long, but scientists do know that in a billion years or less the Sun will be too large and hot to allow the persistence of photosynthesis, and that eventually the Sun will morph into a red giant and cook Earth in the process.
Some additional perspective: the primary rock formation on which most of Manhattan's ranking skyscrapers repose—Manhattan Schist—is itself about a half billion years old. In The Bronx there are rocks 1.5 billion years old.
In another 4.5 billion years (long before the Sun exhausts all of its fuel), our galaxy, the Milky Way, will merge with Andromeda, which is currently 2.5 million light years distant but headed our way on a collision course. The two will begin merging (not colliding, because nearly all stars are too far apart for that) around 4 billion years from now, and will complete into a combined galaxy about 7 billion years from now. Both galaxies have been around for most of the Universe's history.
Here's a simulation of that future. Bear in mind when watching it that it covers the next 8 billion years.
I'm sharing all this less in support of a theory than in support of a perspective: that the Universe is still getting started, and that maybe... just maybe... the forms of life we know on Earth are just early prototypes of what's to come in the fullness of time, space and evolving existence.