Time Machine is a way for your system to back up, I will let Apple describe it they do it best. Go
here for that info. You will need an external HD, something that is about 2-3 the size of the what you have on your HD, the larger the better. Once you have one it's as simple as connecting it and then your Mac will ask you if you want to use it for Time Machine and you OK it. After that pretty much forget about it.
To store your music on an external HD that's pretty easy (and wise) too. What you do is locate the music using Finder. If you have already moved your iTunes music from your PC to the iMac it will be in: users/your user name/Music/iTunes. Simply copy that folder (Command C) and then using Finder click on the external drive and drop past the folder where you want it.
Once that is done you need to tell iTunes where the music is now. How you do that is open iTunes and go to it's Preferences (Command ,) click the Advanced tab on top, then where it says iTunes Media Folder Location click Change and navigate to where you dropped the music and you're done.
Glad you're scanner is working OK now.