Science fiction has been defined and redefined fairly frequently, both by fans and by authors. Since I have some fairly strong feelings on the subject, I figured I might as well cram them into your ears before they get too clogged.
I'm defining here what I consider to be the core of what makes something science fiction, but it differs enough from other people's idea of science fiction that we might as well call it something else. If you have a different conception of science fiction, perhaps you can agree to call this
'Fiction A is Fiction A', after its primary attribute.
First, I'd like to go over previous categorization systems and why they fail.
It should be clear to us, first of all, that setting something in outer space or having it involve computers is neither necessary nor sufficient to make it sci-fi. There was a time when the latter seemed less ridiculous. Let us settle for the idea that science fiction is not predicated upon the existence within the story of unfamiliar technology -- otherwise, a story full of technology that has become familiar will cease to be science fiction (as Terminal Man may soon be, since precisely the technology discussed in that novel is now being used by epileptics). Science fiction should not be vulnerable to the old chestnut about AI -- if everything it describes exists, it's no longer sci-fi.
An old standard, though, is the idea that sci-fi stays with known science as much as possible. I do not consider this a defining element, because it invalidates nearly all science fiction past and present. 1984 is based in large part around a naiive interpretation of the Sapir-Whorf hypothesis; if that turns out to be provably false, does 1984 cease to be science fiction? Dune (and many other science fiction novels from the 1950s-1970s) had in large part a basis in the assumption that precognition and remote viewing are possible. Are they no longer science fiction? Even if we limit it to the body of knowledge that was known clearly at the time of writing, we have some problems. Anathem uses the Everett-Wheeler 'multiple world interpretation', but (like every other use in science fiction) ignores the fact that in order for MWI to hold, no continuity is allowed to interact with any other; this is built into the formalism for MWI. Is Anathem not science fiction, since it selectively ignored science for the sake of a story?
So, it is neither necessary nor sufficient to keep with known science, and it is neither necessary nor sufficient to operate in the domain of not-yet-distributed futures. Placement in time itself is also no good; 2001: A Space Odyssey remained science fiction, as did 1984. So, how do we delineate what falls into the domain of science fiction?
My answer is consistency. Science fiction need not be consistent with known science, but it should be self-consistent. Its capacity for self-consistency, like that of mathematics, will likely be a boon to it in the future. It could also be claimed that by being consistent, science fiction makes itself diverge even moreso from reality, which is famously inconsistent (and when it behaves consistently, does so in baroque and mysterious ways).
So, what cornerstones of science fiction do we in this way eliminate? Star Wars, Star Trek, and Doctor Who do not retain consistency, but they all fail at other tests of science fiction purity. They fall into the domain of fantasy, which is perhaps where they belong.
Perhaps more interestingly, what falls into science fiction under this definition that would not otherwise? The Age of Unreason series does, despite being set in the eighteenth century and focusing on alchemy, because the rules set down for alchemy are not contradicted later on. The Laundry Files series also falls into science fiction, though due to some flukes in early books, the Dresden Files series does not. Hackers, while ludicrously and hilariously at odds with reality, does not break its own rules, and thus falls under the aegis of sci-fi.