Impulsively buying things that you don't really want or need is fine every once in a while — but if you're unable to stop, it may be oniomania, an uncontrollable urge to shop.
Oniomania, also known as compulsive buying disorder, is diagnosed by mental health professionals when someone is so preoccupied with shopping that it becomes harmful and self-destructive. People with oniomania, which is often described as a kind of addiction, often go into debt and damage their relationships. The word oniomania is from the Greek roots ōnos, "purchase," and mania, "madness."