This is one of the most controversial passages of Scripture because of its apparent conflict with passages which teach salvation by grace, entirely apart from the law or any form of works (e.g., Ephesians 2:8-9; Titus 3:5) and absolute security in salvation to those who belong to Christ (e.g., John 10:28-29; Romans 8:35-39).
Actually, many passages warn against deliberate acts of sin by Christians. "He that saith, I know him, and keepeth not his commandments, is a liar" (1 John 2:4). "They profess that they know God; but in works they deny him" (Titus 1:16).
Clearly, there are dozens of "proof texts" on both sides of this question, and it cannot be settled by citing a cliché or two in a brief study like this. There can be no real contradiction in God's Word, however, so the Lord must have had a good reason for inspiring this apparent paradox in His book. On the one hand, it is vital for every true believer in Christ to know that He is saved and has eternal life. "These things have I written unto you that believe on the name of the Son of God; that ye may know that ye have eternal life" (1 John 5:13). On the other hand, it is deadly dangerous for a person merely to think he or she is saved when there is no evidence of a changed life. Such Scriptures as our text give sober warning that professing Christians have no basis for any assurance of salvation if they do not obey His words. "Hereby we do know that we know him, if we keep his commandments" (1 John 2:3). Therefore, "examine yourselves, whether ye be in the faith" (2 Corinthians 13:5). HMM
http://www.icr.org/article/6471/