The naming rules are consistent, but you shouldn't concern yourself with the rules. There's only three things you should know for most usual cases.
Most of the sub domains focus on either browser pipelining, such as separating content from code, or isolating modules, increasing security by using the browser's CORS (Cross Origin Resource Sharing).
Rule 1: Url.getSalesforceBaseUrl().toExternalForm()
will always give you the current host name. Use this if you need to link back to wherever you are in the current context.
Rule 2: Use Page.pageName to reference a Visualforce page in Apex Code. The system will automagically get you where you intended to go. Also see StandardController and related classes for links to standard pages.
Rule 3: Use URLFOR in Visualforce syntax to automagically link to the right host name. You can link pretty much anywhere with URLFOR, including pages like Log a Call or edit pages.
Bonus: The system is pretty smart, and can usually figure out which host name you should be on, so don't try to outsmart the system unless it really is not working as expected based on the above rules.