Philosophy means love of wisdom or love of knowledge as derived from the Greek and Latin. Religion on the other hand translates to: respect for what is sacred or reverence for the gods.
A philosopher may or may not be religious, while a religious person may or may not be a philosopher. Philosophy is a pursuit that seeks to use sytematic tools of inquiry and persuasion. Philosophy underlies: science, religion, governmental systems, and societal norms.
Any religion may or may not influence the previously mentioned forces but it does have a central philosophy in general. However, an atheist can still be a philosopher, or a religious person may use philosophy to question their religion.
Both religion and philosophy are based on sort of underlying system, a theory and an application known as a model. in this sense they overlap as human endeavors but they are still distinct disciplines.
For an example of contrast, though some may consider science to be a form of "idealism" in philosophy or as a new form of religion, there are still historical/ideological differences between each discipline.