Depends on the person. With someone close and important, instantly or at the first appropriate moment. With someone I don't know well enough, or fear, perhaps never - would more likely walk away.
Anger is a secondary emotion. Underneath it is one or more of three primary emotions: pain, fear or shame. I scan my memories to check if anything I said or did could have triggered those responses in the other. If I can't see any that are obvious, then I need to ask the other how he or she is feeling, what triggered it and what the need or request is. I regard this as a process that is valid for friendships, husband, anyone close. Time depends on privacy and the other's priorities but I find that the sooner the better because most people seem very forgetful of details.