Have seen this multiple times, in both cash games and tournaments. Just wondering when is this an important factor? How does it affect strategy?
It affects strategy in no-limit, and especially pot-limit play. Some simple examples: There's $300 in the pot, and you plan to try a $200 bluff to take it. Well, if one of your opponent's only has $50 left, then you're really only betting $50 at him, and he can call with much less risk. Similarly, if you make a $50 bet on an early round, and your opponent only has $80 in his stack, he will be more inclined to call than if he had $500, because in the latter case he has to worry about your future bets as well.
Another case: There's $100 in the pot, your opponent bets $20, and you have a gutshot. You only have 6-to-1 pot odds for an 11-to-1 draw. But consider this: if you and your opponent both have a lot more chips, and you think he will bet when your well-hidden gutshot card comes, and you think he'll reluctantly call your raise, then you'll get paid off at much more than 11-to-1 when you hit. This is called implied odds. So this is an automatic fold with small stacks, a reasonable call with large ones.
In pot limit, you often have a monster, suspect your opponent has a strong second place, and you have to figure out whether betting out or check-raising will get all your opponent's chips in. That's a function of the size of the pot and the size of his stack.
There are thousands of other cases. I wouldn't say that your opponent's stack size matters on every hand (after all, you'll routinely fold most hands), but it matters quite often.
Roy Cooke's book on no-limit poker has an entire chapter called "How deep are you", in which every exercise is a sample hand with different answers depending on stack sizes.