What is the name of the rule that describes why some words are written together (e.g. "strawberry") and others apart (e.g. "street name")?
This is an orthography rule, not a grammar rule. Orthography isn't really a concern for linguistics.
I have a feeling that this is rather arbitrary for English. In German (or a other fusional or agglutinative languages) it's quite simple: Everything which belongs together is written together; English makes things more complicated by basically allowing three variants (written as as one word, separated by dash and written as two words, although it has a strong tendency for preferring the last one, probably reflecting its mostly isolating morphology).
My suggestion would be that compounds which receive a more idiomatic-like meaning are written together, while compounds which can be straightforwardly interpreted by decomposing it into its parts are written separately.
So, street name is really just the name of a street, but for strawberry this is not that obvious; you might in hindsight imagine it has something to do with growing on a straw-filled underground or so, but if you have not heard the word before you can not directly infer the meaning of strawberry by decomposing it into straw and berry. The meaning the compound gets is more conventionally assigned than in e.g. street name, and you would probably assume that strawberry has an own lexicon entry (by "lexicon entry" referring to the mental lexicon, not a concrete dictionary), while street name is spontaneously formed and interpreted by rules of composition.
This is why, I would suggested, such words are spelled as one while other (or most) as two.
After long search I found it, it's called Compound.