Firstly, AVI isn't a codec, it's a container. Therefore it can contain different video codec. Most common used codec in AVI files are H.264, DivX and MPEG-2.
In order to play them in Windows Media Player, you need to install 3rd party DirectShow codec. This can be easily done by installing a codec pack, for exemple K-Lite Codec Pack or Combined Community Codec Pack.
But there is another problem : video decoding requires some hardware resources. For exemple, an old PC with an Intel Pentium III and graphic card without acceleration would never be able to play smoothly an H.264 720p encoded video. Even more recent CPU (if not GPU-accelerated) like Intel Atom encounter some difficulties.
If you have a decent graphic card, implementing hardware video decoding, it helps alot on low-end CPU. For exemple AMD/ATi graphic card with UVD, ie. from HD 3000 serie, or Nvidia PureVideo starting with GeForce 8400.
Unfortunately, there are only a few codecs supported by those. The only one which is supported on all not-so-old GPU is H.264 8bit.
Finally this GPU video decoding needs to be enabled. K-Lite offers an option to enable it at install time. I don't know for Combined Community Codec Pack.
To summarize, you need to install appropriate codecs and avoid playing HD video on old hardware. Also remember to have the latest GPU drivers if using GPU video decoding.