There are two ways as I know
1) Copy the subtitle file (.srt, .idx, .sub, ....) to the same folder where the .avi file is. Then rename the sub file as exactly the .avi file. (or vise-versa). Open the movie file as most of media players will play the sub file as well.
2) Play avi file and simply drag the sub file on to it. But Windows Media Player doesn't support this method.