I'm not sure who our writer was speaking to, but I suspect someone may have quoted something like Isaiah 59.2: "But your iniquities have separated you from your God; your sins have hidden his face from you, so that he will not hear" or Proverbs 15.29: "The Lord is far from the wicked, but he hears the prayer of the righteous."
Certainly these passages, and others including Micah 3.4, Jeremiah 14.10-12, and Job 35.12, seem to imply that God isn't interested in listening to the prayers of the unrepentant. Indeed, the story of Balaam and Balak in Numbers 22-23 indicates that when the prayers of the unrighteous are offered, God may even add a twist to the prayer rather than simply ignoring it.
Some suggest that those who aren't God-fearing believers should have no expectation of their prayers being answered, let alone heard. After all, if they aren't willing even to acknowledge the presence and power of God, why should God listen to their prayers? Accordingly, the best they could hope for is the promise that "God causes his sun to rise on the evil and the good, and sends rain on the righteous and the unrighteous" (Matthew 5.45b).
There are others who believe that not only do you have to believe to be heard, but that you must be in a repentant/forgiven/ righteous state for God to hear and answer prayers. These would hearken back to the passages mentioned above that indicate God doesn't listen to those who are "wicked," i.e., those not in a forgiven state: "He does not answer when men cry out because of the arrogance of the wicked. Indeed, God does not listen to their empty plea; the Almighty pays no attention to it" (Job 35.12-13).
On the other hand, if these notions are pushed to their logical conclusion we would discover that no one's prayers could ever be heard. Paul wrote: "None is righteous, no, not one; no one understands, no one seeks for God. All have turned aside, together they have gone wrong; no one does good, not even one" (Romans 3.10-12). If we are all unrighteous, and if we're truly honest we must admit that we aren't the people God created us to be, then a literal understanding of the prayer prohibitions indicate God cannot hear any of our prayers.
Another legitimate concern would be: how does anyone become connected with God? If God won't hear the prayers of the unrighteous, how do we become righteous?
It seems it all comes down to motivation and to relationships. James wrote, "When you ask, you do not receive, because you ask with wrong motives, that you may spend what you get on your pleasures" (James 4.3). It doesn't matter what state you're in, righteous or unrighteous, if we pray with a wrong motivation apparently God won't be dealing with that prayer. On the other hand, it seems also be true that even if our motivation is pure, if we haven't made a connection, if we haven't chosen to seek a relationship with God, then God's under no obligation to "hear" our prayers.
In the end it is helpful to remember that God isn't Santa Clause. Just because we're good doesn't mean we get everything (or anything) we ask for. God is our creator, our divine parent, and knows what we need. According to Jesus' words, "But seek first his kingdom and his righteousness, and all these things will be given to you as well" (Matthew 6.33). When we are more interested in serving God than ourselves, we can count on all the tools we need to maneuver through life.