The law differs from state to state, but in general terms: self defence by the use of lethal force is allowable, for yourself or in the defence of another, if there is a genuine fear that the victim’s life is in danger from the attacker at that moment in time. However, as soon as the threat declines so does the ability to claim the defence.
As a hypothetical situation, saw a person came at you with a knife where you were genuinely afraid they intended to kill you. You could use lethal force in defence while that attack occurred. But, for example, if you disarmed them and got the knife away, that lethal threat is dissipated and so too does your defence for using further lethal force.
Be aware, as I said, the laws differ state to state, and I don’t practise in criminal law. If in doubt, the old adage of it is better to be tried by twelve than carried by six may apply.