Depends on the religion. But, on the whole, all religions serve as a framework for articulating or expressing values and meaningfulness, which in turn influence perceptions, behaviors, and relationships (aka, way of life). What the "purpose" (if that's the right word to use) looks like for a religion depends on the values it expresses.
As an example, religions that lack concern for an "afterlife" (and perhaps reject the notion of such a thing entirely) are not going to be death-preparing traditions like we see in many traditions of Christianity or Islam. Their "purpose" is unrelated to the idea of a supposed afterlife. Similarly, religions that are non-theistic are not going to anchor their purpose around communing with or honoring gods, much less appeasing them or currying their favor.