In the past, interactive fiction referred mainly to parser-based IF: computer programs that generate textual narrative in response to user input, generally in the form of simple natural-language commands (e.g. "take keys" or "headmaster, tell me about Malcolm"). Following instructions encoded by the designer, a computer sends typed input through a parser to identify its grammatical structure, then respond by describing, in a few lines or paragraphs, whether or to what extent the game world has changed in response to the action requested by the player. The game might also announce that the input was not understood, or ask the player for additional clarifying input.
In chapter 1 of Twisty Little Passages, Nick Montfort writes that the term "was apparently coined by Robert Lafore and popularized by Scott Adams of Adventure International more than 20 years ago... and was then used widely by Infocom to designate their canonical works." (See Lafore, 2002.)
In recent years, the IF community has expanded its definition of interactive fiction to include choice-based works (also called CYOA) as well. In choice-based IF, players navigate through the story by selecting hyperlinks, or by periodically choosing from a list of options to determine how the story will progress.
Related articles: Eric on Interactive Fiction.