First off, the term "fan fiction" is merely a descriptive term, not an insult. There are many brilliant works of fan fiction, and by dismissing the art form as "less than," you need to be aware that you're basically insulting all the authors who pursue it. (I'm not saying that was your intent, just wanted to give you a heads-up).
As far as a definition, "fan fiction" refers to basically any story that incorporates characters or world-building that was originally created by another author. Fan fiction based on modern material often can't be legally published because those characters and settings are still the property of the original creator.
However, there is also a ton of fan fiction based on material that has passed into the public domain, that IS saleable and often very successful. For example, "Wicked" is fan fiction of "The Wizard of Oz," and the reason so many Sherlock Holmes TV shows and stories are hitting the market recently is because those stories recently passed into the public domain.
Additionally, there's often a fuzzy line between "fan fiction" and "licensed/cannon material." The film version of "The Hobbit" took a slim volume and padded it out with a lot of additional material to turn it into a three-film saga. That additional material could reasonably be called "fan fiction," as it wasn't the work of Tolkien. So could those books in the "Dune" series that were written by Brian Herbert and Kevin Anderson after Frank Herbert's death.
If your work isn't actively incorporating someone else's material, than it's not fan fiction. If that's the case, then you may need to investigate why people are saying it is, because it may be similar enough to an existing work that that it gives the impression of being fanfiction "with the serial numbers filed off," so to speak. Otherwise, I wouldn't worry about it.