What is the lifespan of the Earth compared to that of the Milky Way Galaxy?
Milky Way anticipated lifespan 17.6 billion years (before running into another big galaxy). Earth anticipated lifespan 9.5 billion years (before being engulfed by our Sun turned red giant).
To answer this question, let's first talk about when they were created, then when they are anticipated to end, and compare the two.
The Milky Way was created roughly 13.6 billion years ago (compare this to the age of the Universe at roughly 13.7 billion years ago). Keep in mind that the Milky Way at creation was a very different looking galaxy than it is now - one reason is that the Milky Way has been cannibalizing smaller galaxies over its lifetime (and in fact is in the process of doing so to the Canis Major Dwarf Galaxy).
The Sun was created roughly 4.6 billion years ago in a stellar nursery, where there was a rich amount of hydrogen gas. And yes, there were probably other stars birthed there as well, and so our Sun has siblings!
The Earth was created roughly 4.5 billion years ago from a portion of the leftover bits from the creation of the Sun.
When will the Milky Way die or dissipate or go away? The Milky Way is constantly repopulating itself, both through its own stellar nurseries (at the rate of about 7 stars per year) and through stealing the stars of smaller galaxies, so it's unlikely that it will be "lights out" for the Milky Way. One event that may effect the stability of our galaxy is (and according to the link below will destroy it) is a collision with our large galaxy neighbour, the Andromeda galaxy. That will occur in about 4 billion years.
The Sun is expected to remain stable for the next 5 billion years or so, and then expand into a red giant - engulfing the planets Mercury, Venus, Mars, and gulp Earth. The Sun will then spend the next billion or so years as a red giant, before becoming a brown dwarf (so technically the Sun will still exist but it won't be anything like our current, life-giving, Sun.
But Fun Fact - the Sun will be living out it's life watching the destruction of the galaxy.
And we just answered about the Earth - it gets fried by the Sun in about 5 billion years or so. So the Earth too will get to watch the destruction of the Milky Way as a structure. Perhaps the Sun and Earth will be flung off into interstellar space, or be a part of an even bigger galaxy, or... who knows? It's entirely possible that the Earth will be destroyed in the cataclysm to come with Andromeda!
Milky Way Galaxy = 13.6 billion years so far + 4 billion before running into Andromeda = 17.6 billion years.
Earth = 4.5 billion years so far + 5 billion before being engulfed by our Sun, turned red giant = 9.5 billion years.