There are a variety of reasons that a cat might stop using its litter box. The most common reason is that it was never really house trained in the first place. Often a change in the cat's environment may precipitate the first mistake. The litter box may not be clean or maybe it is in an inappropriate place. Most house soiling problems are self-limiting and will clear up within a couple of weeks or months.
Cats are extremely fastidious.
If the problem was initially caused by some environmental change, once the cat has adapted to the change it reverts to its normal clean litter box habits. Resolution will be even quicker with a reward program. If the owner punishes his cat the cat will only learn not to eliminate in front of its owner. This will make retraining more difficult. Now the owner will have to rebuild the cat's confidence.