It is based in part on a paper "The stress response in Fish" by S.E. Wendelaar Bonga, published in Physiological Reviews - Vol. 77, No. 3, July 1997 (for those who are interested and can access is).
By no means does it represent a complete picture, which is not in the least part due to the huge diversity of fish on this planet. Fish represent the largest group of vertebrates on this planet with an estimated 35,000 species (more than all other vertebrate species combined). This is reflected in the huge diversity amoung fish and this isn't any different for their response to stress, which differs as widely amoung species of fish as their appearance.
If there are any questions or you would like me to expand on something, please feel free to ask. Any comments and/or corrections are equally welcome.
Stress in fish
Before it is possible to talk about stress in fish it is essential to define stress. Stress is often seen as something psychological, a state of distress in a person due to a scare, for instance. Here I will define ‘stress’ in a physiological way.
‘Stress’ is a condition in which the homeostasis of a fish is threatened or disrupted by something called a ‘stressor’. The homeostasis is a dynamic balance in the fish that creates a healthy condition. Look at it like a seesaw that is balanced. A ‘stressor’ is something that creates a shift in the normal balance, like pushing down on one side of the seesaw. To get it back in balance an equal amount of pressure (energy) has to be put on the other side. Likewise a fish will use up extra energy to compensate when faced with a stressor.
There are a lot of things that can be a stressor in this way, a predator is an obvious example. Energy needs to be allocated for a ‘fight or flight’ response and this disrupts the normal balance. This is easy to relate to for us as terrestrial mammals, but for fish there is an extra dimension to stress and stressors.
Fish live in very intimate contact with their environment, the water that surrounds them is a source of both water and ions (salts, calcium, magnesium, etc) required for their homeostasis.
The major sites of this intimate contact are the gills (although the skin is also slightly permeable to water and ions). The gill is a structure where the surface area is increased in order to obtain a huge site for oxygen uptake. (A fish of about a pound in weight can have a gill surface the size of a soccer field.) Underneath these respiratory cells are so called chloride cells, these chloride cells are an important site for ion exchange and are sensitive to a hormone called ‘cortisol’. Cortisol is a stress hormone and so this couples back to stress in fish.
In acute stress the brain releases hormones, an obvious example being adrenalin released upon a person having been on a rollercoaster ride. In fish the primary response to an acute stressor are catecholamines (of which adrenalin is one). These have a similar effect on a fish as they do in mammals. Respiratory rates over the gills are increased (can be seen as an increase in the speed at which the operculum, or skin covering the gills, moves) as well as blood flow through the gills, the properties of the blood are improved for oxygen transport and glucose and free fatty acid levels in the blood are increased. All this is done for a quick response to an acute stressor.
For a more complex response to an acute or chronic stressor there is a parallel response pathway which uses cortisol. This response is not aimed at the cardiovascular system, but the hydromineral balance and energy metabolism, as well as that it can reduce growth, reproduction and the strength of the immune system.
Here I will go more into the details of the hydromineral balance, as it’s very specific for fish and covers, in general, the principles that are the cause for fish to favor a specific pH, salinity, water hardness (calcium), etc, those conditions important for a good aquarium with healthy fish. For this I will introduce something called osmoregulation, a process where the chloride cells have an essential task.
Osmosis is a process easiest to understand with a little experiment. A u-shaped tube is divided into two compartments by placing a semi-permeable membrane in the middle. The membrane will allow water to pass from one compartment to the other, but will not allow ions to do so. If a little salt is added to one of the compartments the salt ions will want to disperse equally over the entire tube to create a uniform concentration of salt. However, the salt cannot move across the membrane. As the membrane will only allow water to move across it, the water will move into the compartment with the salt to lower its concentration. This can be observed by a difference in water level.

The salt increases the osmotic value of the water and this can be expressed in a value of mOsm/l. Fresh water, for instance can have a value of 20 mOsm/l, whereas seawater can be 1000 mOsm/l. With a typical value of 300 mOsm/l a freshwater fish is like a compartment that is isolated from its surroundings by a semi-permeable membrane. If the fish does not control its water and ion balance, ions will tend to be lost to the water (they can “leak” out) and the fish will tend to take up too much water, effectively “drowning” the fish.
The regulation of this is called osmoregulation and the fish does this with the chloride cells in the gills (also involved are the kidneys and intestines). The chloride cells will actively take up ions from the water to obtain the right ion balance and a freshwater fish will excrete dilute urine to lose the excess water that was taken up passively. This keeps the fish healthy and happy.

adapted picture, original from Martin Thoene (I hope you don't mind.)
Osmoregulation is why fish are so sensitive to stressors. If an acute stressor is perceived by the fish, it will make the membrane of the gills more permeable to water and ions and thus disrupts the hydromineral balance. Cortisol, the classical stress hormone, regulates the hydromineral balance and will compensate this disruption caused by stress. There will be an increase in the number of chloride cells and their activity. However, this process is not without a cost and will drain the energy of the stressed fish. Under chronic stress this will result in a reduction of growth, absence of energy for reproduction and a weaker immune response.
Factors that are given for good aquarium conditions for specific species are aimed at the intimate contact of the fish with its environment and the way the species is adapted to certain conditions. Salinity, pH, Calcium, nitrate, etc, all affect the hydromineral balance. Different species will have different ranges of water conditions because they have different ways of regulating the hydromineral balance. If the water does not have the right properties it will disrupt the hydromineral balance and this induces stress that causes an allocation of energy away from growth, reproduction and the immune system in favor of restoring the balance. In that way a fish will maintain its homeostasis, although at a cost. This is also why a fish might swim around looking happy, while actually being stressed.