Domain, wildcard, subdomain, directory, how do I choose?

It’s not clear to me why all these exist. When would I prefer one over the other?