The permission checker in the CP will tell you what needs to be 666 or 777, basically all folders are supposed to be 777 and all files 666 (for the editor to be able to edit them).
myself however, I prefer keeping all files 644 and all folders 755 as I don't use the built in editor enough to warrent allowing such permissions to be set on files.