I hear this all the time - "you can't eat after 8pm because you are not going to lose weight". It's a myth.
The only thing that matters is how much you eat and how many calories you burn during the day. Eating at any time of the day causes the body to gain the same amount of weight.
While eating after 8 p.m. won’t increase the amount of weight you’ll gain, there are still some risks with eating late. We tend to overeat when we are tired, so it's easy to grab something unhealthy or just to eat too much in the evening. This is why some people set a rule not to eat after 8pm. If you are able to grab a piece of fruit or cheese in the evening as a snack and stop eating after that, there is no reason why you shouldn't eat in the evening.
I try not to eat late in the evening since I don't sleep well if I eat late. I get nightmares and wake up throughout the night. Also, when I eat a low-carb dinner with healthy fats, I don't need to eat later. I'm full and happy!