d means it is a directory, if you have a file it is - and if it is a link you will find an l. It can't be set/unset.
If you use 0777 as permissions you are giving full control (read+write+execute) to every user/group of the system. It is a lazy way to solve problems when you have users/groups that can't access directories/files.
For example, if you list the content of a directory and get this:
-rw-r--r-- 1 root root 42596 jun 7 2012 preloadable_libintl.so
preloadable_libintl.so is a file owned by user root and group root. The ownerowner has read and write access, the groupgroup has only read access and any other userother user has read access. This can be translated as 644.
If I change it to 777 it will look like this:
-rwxrwxrwx 1 root root 42596 jun 7 2012 preloadable_libintl.so