Any time that a bond is formed, energy is released. Likewise, any time that a bond is broken, energy must be supplied.
In an endothermic reaction, the energy required to break the bonds in the reactants must be greater than the energy released forming the bonds in the product.
For an exothermic reaction, the opposite will be true: More energy is released in forming the bonds of the product than is absorbed to break the bonds in the reactants.