777 basically just means only the owner, members a part of the group allowed to edit it, and other users
on the system can edit it. Someone would need to literally hack into your VPS SSH in order to edit data. If they've done that, the world group setting isn't going to matter as much. Generally, if you have a VPS through another host, they have enough security in place that you shouldn't
have to worry about 777. Again, though, like JamminR said, if you're worried about it, try 770 or 775 first. Keep in mind I'm not an Ubuntu expert, but I know my way around Linux, VPSs especially.
EDIT: Big note though: if you're on a shared server (meaning you server is not installed on the root), I'd highly recommend 770. Especially if the parent folder is 777.
(P.S. Also this is why I want to go into computer science
)