Fan fiction means fiction which is based on existing characters or settings from a professional work of art, such as a novel, movie, or television series. Such works are commonly created and distributed freely on the Internet, although they may violate the copyright on the original work of fiction. (In some cases it has been argued that fan fiction constitutes a form of parody and so is protected as fair use under U.S. copyright law. No U.S. court case has decided this issue, or indeed has dealt with copyright claims on fan fiction, as of March 2006. (The case of The Wind Done Gone, a recasting of Gone with the Wind which was defended as a parody, may be relevant.)
Professional works of fiction using another author's characters or setting (either with permission or because the original work is in the public domain) is not generally considered "fan fiction" — the term is pretty much limited to non-professional works of fiction.
Fan fiction may use or alter the characters or setting of the original in any of many different ways.