Having just been baptized, I have been studying baptism as presented in the Bible. The root Greek word is "bapto", and the derived words are "baptizo", "baptisma", "baptismos", "baptistes".
"Bapto" means to wash fully, to immerse (as in water), or overwhelm. It can also imply "throughout" or "thoroughly". There are several baptisms described in the Bible.
John the Baptist preached baptism for the repentance of sins. This is apparently different than baptism in the name of Jesus (the Father, the Son, and the Holy Spirit) (see Acts 19:2-5, where people baptized by John needed to be baptized in the name of Jesus to receive the Holy Spirit). It appears to have been transitory, for Old Testament saints at the time of Jesus (the apostles, etc. up to and including Jesus).
There is a mention of "baptism for the dead" (1 Corinthians 15:29). This appears to refer to a pagan ceremony (it seems Paul is saying "they do it", rather than "we do it").
Jesus also refers to a cup and a baptism of suffering that He must endure. This is obviously a reference to the crucifixion.
There is also reference to being baptized into the body of Christ through the Holy Spirit. This is a reference to the moment of salvation. When we are sealed with the Holy Spirit.
So who should be baptized? and why? What does our soteriology say? Is baptism necessary for salvation?
Any soteriology must account for the thief on the cross (next to Jesus). This thief was certainly a criminal, and he may have started off mocking Jesus (Matthew 27:44 KJV uses "thieves", although my Greek skillz are non-existant...). But in the end, Jesus told him "To day shalt thou be with me in paradise". No works, no ceremonies, no Purgatory.
Baptism also does not guarantee salvation. Judas was almost certainly baptized, and he is almost certainly in Hell (Jesus said it would of been better had he not been born, Acts 1:25 says he went to "his own place"). Simon the Sorcerer was baptized, but received some serious rebuking (Acts 8:18-24). And today there are plenty of stories of baptized people becoming atheists.
The pattern in the Bible is (relatively) clear. Repent, believe, and be baptized.
I was baptized as an infant. (My local church is very loving and understanding, they would accept that baptism - if my conscience required it. But they teach that baptism should follow belief. And encourage anyone baptized as an infant to study the issue.)
But a baby cannot repent and believe. It took me some thirty years to reach that point. And so I was recently baptized.