Noticeable desynchronization of audio and video streams may appear as a result of many reasons. First, set the sound format to PCM. Some audio devices, for example Sound Blaster Live!/Audigy provide synchronism only at sampling rate 48000 Hz. Try to select video codec and it's settings so that CPU load will not exceed 80%, otherwise there may be dropped frames. It is not recommended to set highest priority in settings. Try different "Interleaving" settings, "Main AVI stream". It is highly recommended to set recording audio stream via PCI if your chipset is capable to do this.
Small desynchronization may appear even on recording audio via PCI by tuner, due to AVI container, (to be more precise, AVI-multiplexer), that binds video and audio streams together in one file. First, this multiplexer doesn't form packets with reliable binding of audio and video packets together in each packet. Second, it stores own internal statistics that may not be controlled and analyzed by external application and depends on many circumstances, for example on used audio and video codecs, and the resulting frame frame rate, that as a rule doesn't correspond to actual audio track length, saves in AVI-header at the end of the recording. To avoid such desynchronization it is needed either fix frame rate in video editor after the recording or use other containers, for example, ASF, WMV or MPEG.