This question has long been on my mind and it has come up again lately. It is my genre of choice so I should know the answer, but the problem is that there isn't one answer. I can only give the one that I have come up with that satisfies me.
As the name implies, it is fiction that relies heavily on science for the setting, plot, etc. To what extent science holds sway determines whether it is Hard SF or Soft (as in space opera) or even cross genre. Now Hard SF is a difficult beast. It is firmly rooted in proven science (no theories, extrapolations, suppositions), though it does tend to push technology forward. It also tends to be rooted heavily in science, whether that be scientists as characters, a science problem to solve, or something else along those lines. Hard SF has its fans, though I'm not really one.
That said, there is Soft SF, the mainstay of science fiction literature, cinema, and television. There are common themes that aren't so based in science, such as faster-than-light travel, transporters, laser swords, mystical beings, ESP, and a whole host of things. Still, it is grounded in science, even if the stories tend to be more the grand adventure or quest.
I've read some articles recently that imply that some sf has gone really soft, almost too soft, by bringing in almost magical things. Some of those are long standing mainstays of Soft SF. I recently picked up a copy of C.L. Moore's Northwest Smith stories. Most were published back in the 1930's. While the character had the hard feel of a space smuggler, most of the stories dipped into Greek and Roman mythology for the villains and then retold it as alien and ancient. Star Trek and Star Wars follow right along with that.
I've also come to the conclusion that while we label things and divide them into specific groups, in reality things slide from one sub-genre into another. Stories have different settings and different levels of technology and different levels of reality. Typically, the stories are set in the next few hundred years and slide from Hard SF to Soft SF, to some sort of fantasy/horror/literature crossover. But you can have stories set much further in the future (like Asimov's Foundation series), you can set it in the past (like Star Wars), or the near past (think Steampunk), or even the present (Starman and Galaxy Quest). So there is a huge range within to work as an SF author.
For my own writing, I prefer to concentrate on the far future and extrapolate scientific and technological developments, but stick to things I think could and may be discovered and developed. I try to keep it real and avoid outright fantasy. Still, it is Soft SF, specifically space opera.
So I think that the real answer to the question is that SF has to be grounded in science. Whether it be Hard SF that sticks to just the facts, or Soft SF, that plays loose with what is possible. And as a side note, it is Soft SF that inspires scientists to make new discoveries more than Hard SF. It is Soft SF that brings in the dreams of what might be and can lead to them really happening.