Answer: No. Weight gain is a result of eating more calories than you burn on a regular basis, not when you eat. Due to their preference or schedule, many people eat later in the evening, before bed or even wake up in the middle of the night to take in calories. If one gains weight doing this, it is due to excess calorie intake, not the timing.
More info
The body does not have an enzyme with a watch that after 7 p.m. preferentially stores items, especially carbohydrates, as fat. We all have a certain number of calories that we can consume without gaining weight. As long as we don’t exceed that number, weight gain will not occur. Imagine this scenario: at your height, weight and activity level, you know that you burn 2750 calories in a 24 hour period. You’ve had a busy day and since your 350 calorie breakfast, you have not had the opportunity to eat. You get home late after a long day and you are starving. At 9 pm you eat an enormous 1000 calorie meal. Added to the 350 calorie breakfast this brings your total calories consumed for the day to 1350 calories. After your late meal you are exhausted and promptly go to bed. Will you gain weight? Simply put, no. You’ve burned 1400 calories more than you consumed. So, the moral here is to figure out how many calories you can have during the day to lose or maintain weight and distribute those calories/foods in a manner that makes you feel your best and prevents hunger.