The trick is to measure your story in words, rather than pages. Your page count depends on arbritrary things like font size, page size and line spacing. You'll find that, when it comes to publishing opportunities, length is nearly always expressed in words.
The first story I sold was 71 words (here). The publisher wanted stories of no more than 75. This competition is for stories of up to 6,000 words. This one accepts stories up to 15,000.
The short answer is that every publisher wants something different, and there's a home for nearly any length of story somewhere, if it's good enough. But of course, in the real world, some lengths are easier to sell.
Definitions vary, but up to around 1,000 words is generally called 'flash' or 'short-short' fiction. The piece I mentioned above is a fairly extreme example — paid opportunities for a piece that tiny are rare, in my experience. But in general, there's an established market for pieces in this bracket.
Up to about 10,000 words is generally still called a short story. As a rule, if you're a novice author, the closer you stick to the bottom and middle of the spectrum, the easier it'll be to sell your work. This makes sense if you consider the publisher's perspective — longer stories take up more of the available space in a paper magazine, or, since authors are usually paid per word, simply cost more. When you're an unknown author, your name won't necessarily be selling copies of the magazine, so it's easier for them to justify making a little investment in you than a big one.
Again, definitions vary. But in my experience, above 10,000 words is the territory in which some people will start to call your story a novella (a mini-novel). I've heard it said that this is a 'difficult' length, or that it's the province of well-established authors who can bank on writing within the universe of an already-successful series. Of course, there's no reason in theory you couldn't write one, but if you're a novice author, the same warnings apply as from the section above.
So after all that, practically, how should you approach length in your stories? My advice would be this:
- Write the story you want. It will help to have a length in mind, but at this stage, don't overthink it.
- When you're finished, edit it. Cut as much length as you can. It will make the story better.
- When you're finished, you've found out how long that story was. If you think it's ready to shop around, now you know what markets you can aim for.
- If you start writing your story and it turns into a novel, that's okay! As you repeat the process, you'll develop your sense of what stories you can tell in 1,000 words, and what stories you'll tell best with 50,000. With experience, you'll find the accuracy of the guess you make at step 1 gets better and better.
Hope that helps.