The answer is — it depends. It depends on the story itself. What are you trying to do. Are you writing a novel? Or a short story?
In a short story, you can get by with a single character. Someone on their own who encounters a problem. A motorist runs out of gas in a remote area. A character has to fend for themselves in a house when left alone. Well, you get the idea. For longer works, you might be able to get by with a single character and you might not. In my Moonbeam Shadowchaser mystery series, I start with a core of Moonbeam, Merlin, a victim and a killer. That’s four characters. Sometimes that’s enough for a novel. In this case, however, I need more characters. I need a few more suspects to make it easier to construct a puzzle. It wouldn’t be a good mystery if we knew who the killer was from the start.
I know what you are thinking. That was the format of Columbo. You’d be right. However more characters helped the lieutenant to get the killer in the end. In most mysteries, however, the reader needs to follow the clues just like the sleuth in the story. How many characters you need depends on how complicated you want your mystery to be. Sometimes, you will need to kill another character over the course of the story. So you will need as many characters as you need victims. Then you will need suspects. I try to have four or five to make it interesting. So I can get up to eight or more characters just between the sleuths, victims, killer and suspects. Throw in a few more witnesses and the number can go a little higher. That’s for a mystery story.
That said, you will find that most of your characters don’t need to be so well developed. The nosy neighbor who sees everything in the neighborhood can be a major character in the story. It can also be a minor character people avoid. That character could be the one the sleuth goes to as a last resort, and finds the clue that identifies the killer, or tells the main character something it needs to get what it wants the most. Other types of stories require a number of characters as well. No one lives completely alone. These are the characters you don’t need to develop, characters like the barista, the mail carrier, the waitress or the cashier in a store. These are minor characters. They usually appear in a single scene or perhaps two, but are not around enough for the reader to get to know. These characters are the ones we need, but we don’t necessarily need to name or even develop. They are the people who root the story in reality.
So unless you are writing a story about a person castaway on a deserted island, you will need more than a few characters. How many you need is up to you. How many characters does a story need? As many as it takes to tell the story realistically.