You actually gain weight immediately, due to the conservation of mass. Eat an ounce of sugar (or anything else) and you gain an ounce, until you poop it out. You just don't feel it because the amounts involved at any given meal is small. But if you ate 10 lb of sugar at one meal... you'd definitely feel the consequences.