Hi, David —
It is traditional to pray for the dead, although not necessarily in that specific form.
We believe that most souls undergo a cleansing from the temporal effects of their sin immediately after death. We call this Purgatory, and you can find it in the Bible in 1 Corinthians 3:15-16.
It's the process by which we are stripped of all that keeps us from being as holy as we can be, for without holiness, no one will see the Lord. (Hebrews 12:14)