My husband says he will leave me if I don't loose weight

We've been married for over a year and a half and since then I have put on 3kg, i weigh 87kg and I'm 5 feet 8 inches . I don't know how it happened but I think it was to do with starting a new job, moving to a new area etc. 
I did start to work on it and go to the gym as much as I could but then I haven't kept to my exercise regime as it's difficult with work. Also my main problem is what I eat, since I work long shifts it's hard to keep to a healthy diet. I always take packed lunches and regularly eat breakfast.
My husband gave me an ultimatum yesterday as he says he wants to have kids and doesn't want me to blow up in size like his friends wives have. I am going to try harder but I'm scared that if I can't loose the weight he will leave me