Does Scripture teach us that we should pray for the dead? Is there any value to it?
One of the first things I noticed that the Bible teaches about prayer is to pray as often as you can. The Apostle Paul says, “Pray without ceasing” (1 Thess 5:17), but that doesn’t mean we pray 24/7 and avoid sleep, eating, or work. We wouldn’t live very long doing that, and we couldn’t support ourselves without working, so why does Paul say, “Pray without ceasing?” A better understanding of this verse is to pray as often as you can, whenever you can, and wherever you can; waiting in traffic, standing in line at the store, and doing anything else during the day. When you have the opportunity, use the time to pray. That’s the context that Paul writes this in. The context of it is, “Always be joyful. Pray without ceasing, give thanks in all circumstances; for this is the will of God in Christ Jesus for you” (1 Thess 5:16-18). It is God’s will that we pray as often as we can, and those prayers should be about giving thanksgiving to God “in all circumstances” (the good, bad and the ugly), and praying as often as you can since this “is the will of God” for us. Jesus commanded us to pray in a certain way, but always for the will of God to be done (Matt 6:9-13). Should we pray? Yes, and as often as possible, but what about praying for those who have already died? Is this biblical? 
The author of Hebrews tells us that “just as it is appointed for man to die once, and after that comes judgment” (Heb 9:27). There’s an appointed day for everyone’s death (Job 8:7; Psalm 39:4; Eccl 3:2), and it’s a one-time judgment. It does not say that after death we pray for those who are dead…to “pray them out of hell or purgatory,” but rather, after death, their judgment comes. For those who have rejected Christ all their lives, there is only “a fearful expectation of judgment, and a fury of fire that will consume the adversaries” (Heb 10:27). That means that there is no second chance to trust in the Lord after death. The Scripture never teaches that. Those who die in the faith “may have confidence for the day of judgment” (1 John 4:17).
The Just and Unjust
The Prophet Daniel, in writing about the resurrection of the just and unjust, says that “many of those who sleep in the dust of the earth shall awake, some to everlasting life, and some to shame and everlasting contempt” (Dan 12:2), but “those who are wise shall shine like the brightness of the sky above; and those who turn many to righteousness, like the stars forever and ever” (Dan 12:3). None of these people who were in their graves could have changed this outcome. They were either saved before death or not saved before death, and they will either rise to everlasting shame and contempt, being separated from God forever, or they will rise and rejoice, and be in the presence of the Lord. The Apostle Paul was very sure about what happens to believers after they die. He said that “we are of good courage, and we would rather be away from the body and at home with the Lord” (2 Cor 5:8), but also of “good courage [because] we know that while we are at home in the body we are away from the Lord” (2 Cor 5:6).
The Day of Salvation
There are a lot of different teachings about the afterlife, and most of it is wrong. Only the Bible shows us what becomes of a person after death. Since no one knows whether their death will come today or tomorrow, the Bible stresses that “now is the favorable time; behold, now is the day of salvation” (2 Cor 6:2b). It doesn’t say, after today or after we die, but now….today is the day of salvation. The author of Hebrews warns us that “Today, if you hear his voice, do not harden your hearts as in the rebellion” (Heb 3:15). How do our hearts become hardened? It is by continually suppressing the voice or conviction of the Holy Spirit. The more times you reject the truth, the harder it becomes to hear “His voice” and believe the truth. The Apostle Paul says that “The Spirit himself bears witness with our spirit that we are children of God” (Rom 8:16). He reassures us that we are the children of God, removing doubt, but for those that are continually suppressing, rejecting, and then scorning the Holy Spirit and the revealed Word of God, the more difficult it will be for the Spirit to “bear witness” to your “spirit” that you are a child of God.
Pray for Laborers
Jesus never teaches us to pray for those who are dead, but for those who are living and still have a chance of trusting in Christ. Jesus did deal with the dead…but it was raising them from it. He didn’t pray them back. They were raised to life in order to glorify the Father and the Son of God (John 11). Jesus tells us what to pray for, and it has to do with the living. He says, “The harvest is plentiful, but the laborers are few. Therefore pray earnestly to the Lord of the harvest to send out laborers into his harvest” (Luke 10:2). These laborers will go out and share Christ, not go to gravesites and pray for the dead. Those who are dead cannot even repent and come to Christ. It’s too late, thus today is the best of days to put your trust in the Savior (2 Cor 6:2).
We can pray for those who have lost loved ones who are grieving over their dead. Grieving over the dead is both healthy and productive. Praying for the dead is not. If you pray, pray for those who you want to come to know Christ and be fully known by Him (John 10). Pray for the living and not the dead. In fact, the living is just as dead as those buried in the ground (Read Ephesians 1:1-7), but there is still hope for the living that they might be brought to repentance and faith…and to Him, the One and only way to be saved (Acts 4:12).
Here is some related reading for you: Do Christians Go Immediately to Heaven After Death? 
Resource – Scripture quotations are from The Holy Bible, English Standard Version® (ESV®), Crossway Bibles. (2007). ESV: Study Bible: English standard version. Wheaton, Ill: Crossway Bibles. Used by permission. All rights reserved.