Heroism, valor, prowess, gallantry are comparable when they mean conspicuous courage or bravery in conduct or behavior especially during conflict.
Heroism, the strongest term, distinctively implies superlative, often transcendent, courage or bravery not only as exhibited by daring deeds in the presence of danger (as in a battle, a fire, or a wreck at sea) but in carrying through without submitting or yielding an eminently arduous but exalted enterprise (as an exploration) or in the same spirit fulfilling a superhumanly high purpose (as the conquest of self or the institution of a great moral reform) where the odds are against one.
Valor has been applied to the quality of mind of one ready to meet dangers or hazards with courage and gallantry <my valor is certainly going … I feel it oozing out —Sheridan > but far more often it implies both the possession of a high degree of sometimes moral, sometimes physical courage and the exhibition of that quality under stress (as in battle) <awarded a medal for valor in action> In contrast with heroism, valor implies illustrious rather than superlative courage or bravery; it carries a far weaker implication of a persistent struggle against odds but a stronger one of fearlessness and audacity in conflict with a powerful enemy.
Prowess has become essentially a literary term in its original sense, in which it differs from valor chiefly in its greater emphasis upon brilliant achievements or exploits in arms.
Often prowess loses its basic implication of distinguished skill and bravery in arms and means little more than success in competition typically as based on the possession of manly skills (as in athletics or hunting).
Gallantry more than valor, its close synonym, stresses mettle and spirit as well as courage and an almost gay indifference to danger or hardship.