Here's why:
* It lacks a complete verb: It only has the word "when," which acts as a conjunction, not a verb. A complete sentence needs a subject and a verb.
* It doesn't express a complete thought: The phrase tells us *when* something happened, but it doesn't say *what* happened.
To make it a complete sentence, you could add a verb and complete the thought:
* "When you stopped by the garden, you saw a beautiful flower blooming."
* "I was happy when you stopped by the garden."
* "The moment you stopped by the garden, I knew you were home."