But after some hundred years they got tired of the earth (if they lived in Middle-earth) and went away by ship to Aman where they lived on forever.
Some that were slain came back, like Glorfindel who died in Gondolin but Mandos let him go back because he sacrificed himself ...
But unlike mankind they were bound to the circles of the earth and when Fionwe destroys it in order to kill Melcor all that is left of the elves (not so much...) is also killed while the spirits of men survive and are involved in the second music of the Ainur
So for Arda elves are immortal but for eternity men are