What an interesting question.
Food addiction is just as real as other kinds of addiction and in some ways harder to handle as there's no 'rehab' as such unless you took yourself off to a desert island and you need to eat to stay alive! The modern world is so full of temptations with adverts for high-fat high sugar foods everywhere we just can't escape it.
There are a few things going on here and one of them is biology! We like to think that we are very sophisticated animals and in some ways we are but the primitive part of our brain that is designed purely to keep us alive at all costs is still very much in control when it comes to our basic survival needs. We are programmed to eat and because we are carnivores also designed to have periods of time when we might have less food. So here is the problem and actually why most 'diets' don't work! When we are hungry we crave high-calorie foods and will eat them in preference to everything else given the opportunity! This is because biologically our bodies will always be 'thinking' that this might be the only food we have for a while so we need to 'fill up' the best example of this, if you want to test yourself is to see what happens, at a buffet or an all you can eat restaurant. You need to be a very mindful eater with great self-control in this situation not to just fill your plate up and keep going back for more. Plus your internal dialogue will be telling you this is ok, you will just eat this and then diet tomorrow or its ok because you have taken some exercise so you can have extra cake!! So when you resist high fat and high-calorie foods you are fighting your own body and some people find this harder than others! The other issue with this is that is we consciously deny ourselves certain things like the foods we like the taste of we will crave them all the more.
The other issue is also biological and psychological. Your body turns all carbohydrates into sugar and the more refined that carbohydrates are the faster this happens. So refined carbohydrates like pure sugar and those found in pasta and white bread are really quickly absorbed and they give you an emotional 'high' as your blood sugar shoots up but then as insulin is released to bring the blood sugar back under control you find you don't feel as good which leaves you craving another 'sugar fix'! It's easy to get into a pattern of affecting your mood with food and it's hard to break this cycle as it takes willpower and also an understanding of the biology and chemistry involved. It has been proved however that if you reduce the amount of sugar in your diet for several weeks your body stops craving it and there have been a few books recently written on low sugar diets that have back this theory up.
Mind has got some really good information on their website about how food affects your mood. www.mind.org.uk
So when does a habit become an addiction? I think that with food as with other addictive behaviors the answer is when it's having a detrimental effect on your mind and body and starting to control your behavior and affect your life.
There are things you can do to help yourself, of course, learning more about the way your body works is one, keeping a food and feelings diary is another and also taking time to look at the underlying reasons why you might be using sugar to make you feel happy and finding healthier coping mechanisms.
If you are finding that your cravings are causing you problems either with your health as you are overweight or are at risk of heart disease or diabetes or with your mental health then its time to get some professional help from a counselor who specializes in addiction.
I hope this has answered your question and I wish you all the best for the future.