Whenever there is a change in litter box habits, the first thing you absolutely must do is take the cat to the vet. This is often the cat's way of telling you that there is something wrong.
This will often happen when the cat has had painful bowel movements. The cat associates the pain with the litter box and becomes afraid to use the litter box to poop in. Again....take the cat to the vet to make sure there isn't a physical problem.
Also, many cats will do this if they don't think the box is clean enough. Just imagine yourself sitting and concentrating on a toilet full of excrement....not a pleasant thought! So, make sure you keep the litter box very clean (scoop daily).
Many people find that their cats prefer to use one box for urinating and another box for pooping. So, bring in a new litter box and see whether that helps. And...scoop both daily.
Please let us know what the vet says. Once we get the scoop from the vet, we can give you other ideas.