Can you be punished for planning a crime and what constitutes "planning"?
The intent to commit certain classes of crimes is punishable. That being said, there is a difference between intent and a mere wish.
Intent is inferred from statements or circumstances indicating that a person's actions were (or are) devised toward knowingly committing the underlying crime. The Black's Law Dictionary defines intent as "[D]esign, resolve, or determination with which [a] person acts. [...] [M]ental action at its most advanced point [...]. It is the exercise of intelligent will, the mind being fully aware of the nature and consequences of the act which is about to be done" (brackets added).
By contrast, a wish that goes no further than fantasizing or expressing "I want to do this" usually is inconsequential from a legal standpoint.
One exception to the previous statementthat relates to promoting offenses such as terrorism, murder, and arguably pedophilia. Even if it is proved that the person making those expressions has no propensity or intent to indulge in the criminal conduct he depicts, the expressions themselves might encourage others to do so. That encouragement makes it more difficult for a government to prevent those crimes from being committed and to identify the perpetrator(s).