Indeed there are rules. According to proper German orthography, in names or terms like this you have (obligatorily!) to hyphenate everything up to the type of the institution or object. (The technical term for this is Durchkoppeln.) So the correct spelling is
Unfortunately, this rule (which you can look up in all authoritative orthograpic guides, starting with Duden) is increasingly less observed, clearly due to US American / English habits.
Also, many institutions who are internationally active, decide to present themselves in "international" (actually: US American) spelling, hence you find things like
Leibniz Universität Hannover
which in the eyes of some looks "cooler", but is against the rules of German spelling (and causes a sick feeling in orthography-aware people). I suppose the heads of these institutions are actually aware of the rules, but in their urge of being internationally compatible they decide to break them, especially for their logos. And from the logos the bad spelling finds its way into occurences in ordinary text.
Finally, things like
are a total mess, as they mix both spelling traditions in the worst possible way. The German reader interprets the hyphen as a binding which is closer than a non-hyphen / blank, and so Robert Koch-Institut would be the Koch-Institut (cooking institute?) of some person called Robert. That's plain nonsense here.
(See however David Vogt's alternative answer. He points out that the silly spelling is actually recorded as "official" spelling for this institution, in the legal documents that establish the institution. Which now opens the floor for you to choose which spelling you prefer: the good one, or the legal one. If you are an employee of the institute, you might be obliged by your superiors to use the legal one. If you are a journalist, book author or otherwise independent advocate of German language and culture, you might prefer the good one.1)
Sidenote: given the recent prominence of the Robert-Koch-Institut, here is a business idea for somebody looking for an opportunity: open a restaurant and call it Robert's Koch-Institut. (Yes, the apostrophe is wrong, as German does not have genitive-s separation by apostrophe, but shop owners ignorantly use it all the time.)
1 The problem here is similar to the problem authors have to deal with when a company starts calling itself e.g. SIEMENS, in capital letters, and possibly registering its name that way at court. The "official" name of the company is then indeed SIEMENS, but no good journalist or author would spell it that way. It is still Siemens, all the more as this is not an abbreviation such as CDU or RWE but a proper family name. We do not have to follow all the marketing mannerisms of corporations in our writing.