It's one of those How long is a piece of string? questions. So much depends on why you want to write and what you hope to achieve by it.
If you're writing for your own pleasure, that's an end in itself. You've only one reader to please, and if you do that you've succeeded. Job done.
If you're writing to communicate, then you need to be clear as to who you want to communicate with and what you want to communicate. Who is the target audience for your message. That may be a fairly small target or a very broad one, but your message must be accessible to them. If they don't understand or don't agree with what you're saying, that's not their fault, it's yours.
And if you're writing for a living, or in the hope of making a living, you again need to identify your target audience, but you also need to adapt your style, subject or both to the requirements of as broad an audience as you can reach. Figure out who it is who buys the kind of books you want to write. (In my field, oddly enough, more crime novels are bought by women of middle age and older than any other demographic. Go figure.) And give them what they want. Which isn't necessarily what YOU would buy if you were the target audience. If you sell shoes, you sell shoes to fit your customers. Same thing if you want to sell books.
It definitely doesn't mean writing down to them. There are many different styles of shoe as well as different sizes. There are writers who make a good living endlessly recycling the same basic premise, wherein either boy meets girl, loses girl, finds girl again, or the body's in the library and the butler did it. I'm not one. I like to stretch my audience a little; and happily, by now, my audience seems to like being stretched. They appreciate good writing which is also creative, and don't necessarily require a denouement scene in the last three pages where the murderer is identified from half a dozen suspects. That works for some writers: I like to go into a bit more detail in the way of character and motive.
But my audience wouldn't be happy to play along if I suddenly switched to writing romances, rock memoirs or smut. (Incidentally, the quickest way to end a promising literary career is to venture into a field where more people want to write the books than to read them.)
So it's a damn good question, and if we all knew the answer we'd all be a lot richer than we are, but it's certainly worth every writer figuring out an answer that works for them before spending too much time at the computer.