When you restore, you don't have to wipe anything.
When you flash a ROM, wipe everything
Flash a kernel or theme, wipe cache and dalvik. Might not be necessary depending on what's being flashed, but unless it says otherwise you should wipe these.

Note:
Wiping data will remove your apps, personal info, logins, and settings.
Wiping system will remove system apps and everything else needed for the phone to run, or even boot.

thanks for the easy to read reply. also, what would happen if you dont wipe these different things?

Sorry for so many questions. Just a very curious noob who wants to know everything

Click to expand...

Lets say if you are flashing CM9 rom to the phone and don't wipe cache or data , as you begin to use the rom you notice it'll be unstable and it'll feel real sloppy. You could end up with lots of reboots as well as force closes because those cache and data are incompatible with that new rom you have installed. There are time as well when you phone will be in boot loops because you didn't clean your previous rom properly. So yeah, if you don't wipe there will be corrupted files that wont be so friendly with the new rom.

Note ; there are times when you don't need to wipe data (data only), as seen with gingeresteen to gingeresteem extreme. Why? Because those "custom roms" are built from the same core so all the files and source codes are the same. Data as manlyparasite said is all the information and applications you have installed into your phone.