The answer is both. Fish species are adapted to specific salinity ranges:
Live in rivers, lakes, ponds, streams (salinity < 0.5 ppt). Examples: trout, bass, catfish, carp, tilapia, goldfish, pike, perch.
Live in oceans, seas, coral reefs (salinity ~35 ppt). Examples: tuna, salmon (anadromous), cod, snapper, grouper, marlin, clownfish.
Some tolerate wide salinity swings: salmon, steelhead, striped bass, bull shark, tilapia, molly. They migrate between fresh and salt water (anadromous/catadromous) or inhabit estuaries.
Evolution has produced specialists for each realm—and versatile generalists for the margins.