A starship was any manned spacecraft that was capable of viable interstellar travel, i.e. any manned spacecraft that had the ability to transport and support a crew across interstellar distances. Most starships accomplished this via the employment of some form of faster-than-light spacecraft propulsion technology, such as warp drive.
In the Federation during the 22nd and 23rd centuries, spacecraft of the Starship-class were identified exclusively as vessels operated by Starfleet, or as stated by R.M. Merik, "a very special vessel and crew." (TOS: "Bread and Circuses") Starships also did not generally transport cargo, unless in the case of an emergency when they do anything. (TOS: "The Cloud Minders")
By the mid-24th century, though, the exclusivity of the term "starship" had essentially fallen out of use, and was redefined as a term interchangeable with "spaceship" and "spacecraft". (Star Trek: The Next Generation, Star Trek: Deep Space Nine, Star Trek: Voyager) When the Ferengi Marauder Kreechta was about to target the USS Enterprise-D, after interfering with the battle simulation Operation Lovely Angel, the Ferengi ship's sensor codes were overridden and it was fooled to believe there was "another Federation ship" closing. When it was further revealed that the Federation ship was in fact "a starship," the Ferengi feared that they had been outmaneuvered and quickly retreated. (TNG: "Peak Performance")