777 is generally discouraged. While it *can* be ok, it's almost always safer to go with 755. The reason is that, if you are on a shared server from your host, if another site is hacked on that server (unrelated to yours), a perpetrator could *possibly* access and modify your files if they are set to 777. That last 7 means 'anyone with access to the server can write to the file'. If you have a dedicated server where it's only your sites, 777 is generally ok.. but I'll never say 'go for it'. You'd need to know your setup and understand the risks more fully.
With that said, going back to 755 shouldn't be a problem. Once the files are written, they shouldn't need to be modified again (until you need to update). Directories like /tmp, /log, /cache, and /image may need to be 777 so that normal file writing can occur there, but the /components, /libraries, etc directories (generally) shouldn't be written to through normal operation of your site... hence, 755 is a good recommendation for directories and 644 is good for files.
Hope that helps explain a very difficult subject to grasp!
Alex