As an atheist, I've thought about this question for a long time.

I eventually settled on the conclusion that, since I only get so much time to be alive, the purpose should be to fill it with as much happiness as possible. That means working hard, forming friendships, and doing things that bring me pleasure.

The bottom line is that there is no real, substantial purpose. Religion formed, in my opinion, largely to help people cope with this idea, albeit by essentially refusing to accept it.

It'd be nice to die as someone whose name isn't easily forgotten, but when it boils down to it, once my friends who knew me are gone, I might never have existed in the first place.