Every state has different laws about when/why you are allowed to engage with deadly force against another human being. Generally it is permitted when you face a threat of inescapable, serious bodily harm. Sometimes the law is more permissive than that. Look up "duty to retreat," "stand your ground law," "castle doctrine," and "justifiable homicide."
If an unarmed person is stealing your car in California, it's unlikely that shooting at them would be lawful. However, California law imposes no duty to retreat, this article is about "violent robberies," and it specifically discusses getting held up at gunpoint. Someone under those circumstances would likely be permitted, under law, to kill the robber. That may not be true in states with duty to retreat laws.
The fact that every state has a unique approach to this question means that there really isn't a satisfying and succinct answer to your question.