When two light nuclei fuse (a light nucleus is anything lighter than Iron), the resultant larger nucleus has a mass that is less than the original two nuclei. To put it another way: the larger nucleus has a mass that is less than the sum of its parts.
When a large nucleus splits into two (i.e. undergoes fission), the combined mass of the resultant smaller nuclei is less than the mass of the original nuclei.
In both cases there is said to be a mass defect. The missing mass is released as energy – and the amount of energy released can be calculated using the mass-energy equivalence equation, E=mc2. The total energy that is released when a nucleus is formed is called the binding energy of the nucleus. Conversely, the binding energy can be thought of as the energy that must be supplied to break up a nucleus into its constituent protons and neutrons.
Fission is used to generate energy in nuclear power stations. We use fission to generate the energy required to create steam, which is then used to power the turbines to generate electricity.
Fusion reactions occur in the Sun. Hydrogen nuclei (such as deuterium and tritium – basically, hydrogen with extra neutrons) fuse to form helium, and the mass defect is released as energy.