I've been told that the body can store up to 3 days of glycogen, and consequently takes about that long to transition into ketosis. You can feel lethargic and possibly even nauseous during this time (some of my friends experienced the latter where I only experienced the former).
The initial stages of ketosis are rather inefficient, and it takes about three weeks for the body to be completely attuned to the state of ketosis. As a result in this first three weeks your weight loss will be higher than subsequent weeks--but the subsequent weeks will be losing a healthy amount of weight week after week.
That said, when you are in a full state of ketosis (i.e. past the 3 week mark) the transitioning in and out seems to go a bit quicker. Part of the reason is that the body hasn't fully restored its full glycogen levels yet, and it is still attuned for ketosis. Assuming you aren't suddenly introducing thousands of calories in the form of carbs, and the odd meal is reasonable, there will only be a mild stall in your weight loss for that week. I.e. instead of losing 4 lbs you might only lose 1/2 lb or 2 lbs that week.
The important thing is to make sure that one cheat meal doesn't become 5.
Finally, when you are completely transitioning off of ketosis, be careful how you reintroduce carbs. Your body has to get used to processing that type of food again, and simply turning on the floodgates of carbs will cause you to store more of that food as fat than you normally would. There will be a one time 2-5 lb gain as your body is bringing back online the hormones and metabolic processes that process carbs so plan accordingly. To come completely out of ketosis:
- Spike your carbs all in one meal (most convenient would be morning). Have one serving (up to 20-30g) of each representative type of carb you are going to continue eating such as grain, dairy, fruit, and fats.
- Have no other carbs throughout the day
- Repeat for two weeks.
This is information from the ketogenic diet I was on, and unfortunately all the reference material is on paper so I can't provide the links to it.
That said, 3 total weeks to get into efficient ketosis, 2 total weeks to get completely out of it. Once in full ketosis, time to recover depends on how much of the gycogen stores you built up during your meal. Very likely you will recover within 24 hours.