A lot of things can affect it. Your familiarity with the genre is one. If you're used to writing mysteries and now you're writing a horror short story, it might take more time to get into the groove. The length of the story also matters. A 5 - page short story will generally take less time than a 20 - page one. And don't forget about the editing process. If you're a perfectionist and spend a lot of time on editing, that'll add to the overall time it takes to complete the short story.
The main factor is your writing experience. If you're a novice, it'll likely take longer as you figure out the basics like plot, character, and dialogue. Another factor is the complexity of the story. A simple love story may be quicker than a science - fiction story with lots of world - building. Also, your inspiration level matters. If you're highly inspired, you'll write faster.