While chatting you will be asked about saving chat logs and there you can enable this feature. This feature can be enabled in the Google Talk by clicking on the settings option and then selecting the Chat option and then clicking Save Chat history in My Gmail Account Option.
It can be saved using your Gmail account by first selecting the gear menu on the top right hand side of your Gmail account and then clicking the settings option and then selecting the Chat tab from the horizontal menu bar. Click the Save Chat History in the My Chat Save History option. Now click Save Changes and you are done!