Elements up to and including iron can be produced exothermically by fusion reactions in stars - basically banging nuclei together or attaching alpha particle to nuclei. Producing heavier elements in this way would be endothermic. The reason for this is that the binding energy per nucleon is maximised in nuclei around the "iron peak". This means that if you tried to add something to an iron nucleus, the resulting nucleus would have a smaller binding energy. This would be like taking a mass out of a deep well and then putting it back in a shallower well. To do this you have to supply energy.
[EDIT: It is actually a bit more subtle than this. The binding energy per nucleon curve is quite flat near its maximum and so in principle, alpha capture could continue and produce some heavier elements. However, to overcome the additional Coulomb repulsion would require higher temperatures and pressures and in such environments, the background radiation of thermal photons would be capable of photodisintegrating the nuclei produced.]
What this means is that fusion reactions up to iron can be a source of heat, which leads to pressure that is able to support a star against its weight. Fusion reactions that produce heavier elements beyond iron may actually extract heat from stars and are potentially destabilising.
Elements heavier than iron are predominantly produced by neutron capture in the r-process (during supernovae or perhaps neutron star collisions) or in the s-process (inside intermediate mass or heavier stars before the ends of their lives), followed by subsequent decays (see Origin of elements heavier than Iron (Fe) ). These reactions are possible because they require less extreme conditions than fusion, since neutrons are neutral and not strongly Coulomb-repelled by iron nuclei, but they are comparatively infrequent, because they need a strong source of free neutrons, and don't produce large quantities of heavy elements. Although s- and r-process may still be mildly exothermic, they are energetically unimportant in the life of a star.
The fact that stars are able to produce elements beyond iron was conclusively demonstrated in the 1950s, by observing the presence of the radioactive element Technetium in the atmospheres of some evolved asymptotic giant branch stars (Merrill 1952; Merrill & Greenstein 1956). These vast stars produce free neutrons in their interiors and Technetium is produced by the s-process and convectively mixed to the photosphere. Since the half-life of even the most stable Technetium isotope is only 4 million years (and the stars are much older), then it must have been produced in the star.