I also don't eat whole foods all the time, but I aim to eat mostly stuff that's not processed or that I made myself.
For me, it takes about 2-3 weeks to lose the sugar cravings (I know this because I fell off the wagon too many times :| ).
What helps me is eating fruit. It's a bit sweet, but it has fiber, so it fills me up. Basically, I try to replace all my snacks with either a hand full of nuts (up to one hand full a day) or a piece of fruit.
At some point, I realized that the apple was actually more appealing to me than the cookie (at probably half the calories, and tons more nutrients and minerals).