the heat of reaction is based on a specific set of moles of reactants reacting with moles of products.
however, the heat of formation is the specific set of moles of reactants reacting with 1 mole of product.
eg.
N2 + 3H2 --> 2NH3 (delta H = x)
0.5 N2 + 1.5 H2 --> NH3 (delta H = x/2)
the former is the heat of reaction, while the later is the heat of formation of ammonia.