In 1 John 5:16-17 the author is writing to professing Christians who commit sin which leads to death. Christian interpreters differ in their understanding of the passage.
Some think it refers to a professing Christian who shows that he is not a true believer by his unrepentant rejection of Christ and identification with His enemies. Others believe that the author is referring to true believers whose persistent, willful sinning results in God's penalty of physical death.
An example of this can be found in 1 Corinthians, chapter 11, where Paul is warning Christians about participating in the Lord's Supper without any regard for its significance. The story of Ananias and Sapphira in Acts 5:1-10 may be another example of physical death as a penalty for sin.
John does not forbid intercessory prayer in the situation he has in mind. Since we do not have sure knowledge of what John is referring to back in the first century, it is certainly wise to pray for professing believers who engage in persistent sin of one kind or another.
Neither should we forget in our own situation that whenever the Holy Spirit convicts us of sin, we should be quick to confess it and forsake it. One of the wonderful promises of the Bible is found in 1 John 1:9: "If we confess our sins, he is faithful and just and will forgive us our sins and purify us from all unrighteousness."