When exactly do scripts have to be named exactly the same as the class they contain?

Am I correct in thinking it is only when a C# script contains a static class?

It's when you want to attach a script to some object. Static classes or not makes no difference.

Uhm, with C#, scripts should always have the class name equal to the filename (if that's what you mean), at least if you want to use them. Sorry if I misunderstood: this question puzzles me :P

It's only C# objects that derive from MonoBehaviour that you want to attach to another object.

This is like 90% of the use of scripts anyways, so it's a good idea to name files after classes.