If you want everyone to come and mess up your files then go ahead.
Basic rule is that CHMOD 777 or 775 for folders and 644 for files.
If you're installing php scripts there's usually said in readme/manual what rights each file should have. Oh and 'google' if you want to know moar.
if you chmod 777 a file or folder you are giving write permissions, so if you want to write in a file or a folder with your scrip you need to chmod it to 777.
if you don't need to write it, it's recommended to chmod it 644, because having important files in "777" is a risk