Primary freshwater fishes are those that have remained, as far as we can tell from the fossil record, in fresh waters throughout their evolutionary heritage. Fishes that fall into this category include Characins, Carps and Catfishes.
Secondary freshwater fishes are those that had marine ancestors at some point in past time, but which moved into freshwater in order to occupy various niches. Cichlids are an example of secondary freshwater fishes - their nearest relatives are the marine Damselfishes of the Family Pomacentridae, and it's highly likely that both Families shared a common (and marine) ancestor.
Consequently, the secondary freshwater fishes still have at least some degree of osmoregulatory capacity for dealing with salt in the water, while the primary freshwater fishes never evolved it in the first place. So, placing primary freshwater fishes into water containing salt is a bad idea, and even modest amounts will kill them. Secondary freshwater fishes, on the other hand, can tolerate small amounts of salt, and indeed some members of secondarily freshwater Families are brackish in nature - the Cichlid fish Etroplus suratensis springs to mind as one example. Cyprinodontiformes also fall into this category - both the egg-laying Cyprinodontidae and the live-bearing Poeciliidae are also secondarily freshwater, some of the latter Family being fully brackish in the wild (indeed, the Giant Sailfin Molly, Poecilia vivipara, is fully euryhaline, and can live in fully marine water, as specimens captured in seawater off the Yucatan Peninsula in Mexico testify eloquently).
Quite simply put, if your aquarium contains any primary freshwater fishes, do NOT add salt, as those fishes will suffer considerable stress if exposed to salt, and may even die. Even in the case of secondarily freshwater fishes, salt is only a good idea if the fishes concerned are KNOWN to inhabit brackish waters in the wild.
Most fishes fall into the category of being stenohaline, namely, they are either freshwater or fully marine. These fishes should only be exposed to the kind of water in which they occur in the wild with respect to salt content. Euryhaline fishes, that can migrate with some degree of freedom between freshwater, brackish and fully marine environments, are much fewer in number, and tend to be conspicuous in this regard when encountered in the textbooks - fishes such as Scats, Monos, Therapon jarbua, velifera Mollies and one or two of the Puffer Fishes are notable for this. Within the euryhaline division, there are those that can migrate more or less at will, and those that do so developmentally - the Puffer Fish Tetraodon nigroviridis is developmentally euryhaline, spending its juvenile stages in freshwater before migrating at a steady pace to increasingly saline waters until, as adults, they are strongly brackish or fully marine fishes. Once again, and I cannot stress this enough, it pays to do the research and find out what your fish is!