Your grammar book is right. "I stopped smoking" = "I quit smoking" (I don't smoke anymore), or I just ground my cigarette on a special occasion for a particular reason. "I stopped to smoke" = I came to a rest to light a cigarette.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.