Jesus told us in Matthew 7:7:
Ask, and it shall be given you: seek, and you shall find: knock, and it shall be opened to you.
So for whom shall we pray?
I think we need to pray for those who need our prayers the most. The dead have lost their physical shell; they cannot make amends even if they want to. Next in line are the dying and the sick, who still have a chance to accept and welcome Jesus into their hearts. As for the living, they need our prayers but not as urgently.
Some people think that the dead do not need our prayers. I, however, believe that we should pray for them; we should pray especially for those who did not accept Jesus as their Saviour during their life on Earth. Our loving intercessions will help these departed souls see the light.