Usually the plot leads to the setting. If you got a general plot idea, you could probably already decide if it'll be the time, environment, ... You could, of course, always take the not-so-obvious way, like putting a fantasy story (a la LOTR) and put it in modern times/the future. Don't worry about the details, they'll come eventually.