Warship
A warship is any vessel, whether on the ocean or in outerspace, built specifically for combat. They are heavily armed and carry defenses appropriate to their combat role (armor, ECM, etc.).
Star Trek
While most Federation starships in the TNG-era of Star Trek are warships, they lack the design focus of a truly dedicated warship. They tend to serve multiple non-military functions including exploration, scientific research, diplomatic negotiations, and transport in addition to being the Federation's main line of defense. This is in stark contrast with TOS where the ships tended to be more focused on defense and exploration.
It appears that following their alliance with the Klingons and the silence from the Romulans for so many years, the Federation felt they no longer needed such a high level of military readiness. With the increased threats from the Borg and Dominion, the Federation has realized that they are not as safe as they thought and have once again built starships explicitly for combat, such as the Defiant-class.
Star Wars
The Galactic Empire has many classes of warship, including -- but not limited to -- the Imperial Star Destroyer and Executor-class Star Dreadnaught.
The ships used in battle by other organizations may or may not be true warships. The "battleships" of the Trade Federation, for example, are converted transports.