Roll as soon as he is declared as an attacker or is attacked. One roll covers the whole battle, including any COUNTER ATTACK.
On a failed attack roll, his attack for the turn is used up. On a failed defence roll, the attack goes straight to your LIFE, even if you have other UNITS in play.