While opinions on the purpose of baptism vary depending on the religious group, common purposes include the baptized person professing faith and being initiated into a church group. Baptism is also a way to cleanse a person of his sins and save him.
The purpose of the baptism affects when a person is baptized. Religious groups that believe baptism is a profession of faith generally feel that the person must be old enough to understand this. Groups that believe baptism cleanses sins often baptize children or babies to save them right away. Some groups refer to baptism of infants as christening them. Some religious groups don't consider baptism necessary.