A prot warrior will switch out of defensive stance to use one of the following abilities:
- Shattering throw
- Colossus Smash
Everything else you need is available in defensive stance. You might however also choose to switch to battle or zerker stance in 2 tank fights when you aren't tanking, to ensure that you don't pull threat back off the other tank. Personally, I tend not to use zerker stance because of the increased damage taken (which isn't significant, but neither is the bonus damage I get from zerker in the grand scheme of things). Beware, you can receive critical hits if you are out of defensive stance, so you use those abilities when you are not being hit.
As for arms warriors, there are a few answers. Arms can sometimes eek out more DPS by weaving in zerker stance. It's an advanced thing, if you aren't serious about arms then probably don't worry about it. The other thing is the scenario you describe where a dps warrior steps in to take over from the tank. It's certainly worth having a macro which equips a 1h+shield, possibly also popping shield wall, that you can press to 'save the day', and if you were doing that you'd do it in defensive stance. You might use the same macro to mitigate bursts in raid damage, but in that case it's up to you to decide if you'll also switch stance. You can also mitigate some raid damage just be switching into defensive stance (e.g. for a spike like crackle at nef) but that's a DPS loss, so you'd only do it situationally.
I have z, x and c on my keyboard as my stances, with macros that mean 'press once for stance, press again for action commonly associated with that stance'. e.g. press z for def stance, press z again to taunt.