Elements above iron in the periodic table cannot be formed in the normal nuclear fusion processes in stars. Up to iron, fusion yields energy and thus can proceed. But since the "iron group" is at the peak of the binding energy curve, fusion of elements above iron dramatically absorbs energy. (The nuclide 62Ni is the most tightly bound nuclide, but it is not nearly so abundant as 56Fe in the stellar cores, so astrophysical discussion generally centers on the iron.) Actually, 52Fe can capture a 4He to produce 56Ni but that is the last step in the helium capture chain.
Given a neutron flux in a massive star, heavier isotopes can be produced by neutron capture. Isotopes so produced are usually unstable, so there is a dynamic balance which determines whether any net gain in mass number occurs. The probabilities for isotope creation are usually stated in terms of a "cross-section" for such a process, and it turns out that there is a sufficient cross-section for neutron capture to create isotopes up to bismuth-209, the heaviest known stable isotope. The production of some other elements like copper, silver, gold, zirconium and lead has been thought to be from this neutron capture process. It is referred to as the "s-process" by astronomers, from "slow" neutron capture. The role of the s-process for elements like gold has recently been brought into question by research into neutron star mergers like that cited below.
For isotopes heavier than 209Bi, the s-process doesn't seem to work. Current opinion is that they must be formed in the cataclysmic explosions known as supernovae. In the supernova explosion, a large flux of energetic neutrons is produced and nuclei bombarded by these neutrons build up mass one unit at a time to produce the heavy nuclei. This process apparently proceeds very rapidly, in the explosion of the supernova, and is called the "r - process" for "rapid neutron capture". Chains of buildup that are not possible through the s-process happen very rapidly, perhaps in a matter of minutes, with the r-process because the intermediate products don't have time to decay.
The layers containing the heavy elements may be blown off by the supernova explosion, and provide the raw material of heavy elements in the distant hydrogen clouds which condense to form new stars.
Recent research suggests that the heaviest elements may be formed primarily in neutron star mergers rather than supernovae (Frebel & Beers, Physics Today, Jan 2018). The detection of evidence of nuclear synthesis in the observed gravity wave signal from merging neutron stars suggests a larger role in heavy element formation.
Chaisson & McMillan
"Metals" to an Astronomer
It is common practice for astronomers to refer to the entire collection of elements heavier than helium as "metals". Since the vast majority of atoms in the universe are hydrogen or helium atoms, this has been a convenient tradition. Stars can be classified according to their "metallicity" or content of heavier atoms. Because the nuclear synthesis occurs in stars and can be distributed into space at the end of the stars' lifetimes, younger stars may have picked up some of this content from previous stars and therefore be more metal-rich. The metallicity is sometimes indicated with a symbol Z and young Population I stars have been found with metallicity as high as Z = .03 . If a star is found to be "metal poor", it is taken as an indication that the star is old, having formed before the ending of other stars' lifetimes had distributed the background material containing heavy elements.
Carroll & Ostlie