how to put on weight: with science!
in general, your body switches between two metabolic states based on whether or not it's in the process of digesting food. these are called the absorptive state, and the post-absorptive state.
here's the breakdown:
ATP is what your cells use as energy. the body produces ATP mainly from glucose, which is produced/extracted from the food that you eat. your body needs to keep the amount of glucose in your blood at a certain level to maintain homeostasis (optimum functional balance). not enough means you can't produce energy, and too much will throw your metabolism out of balance (production of energy = production of heat; too much heat = fever, death).
so when your body is getting a lot of glucose out of a meal, it switches to the absorptive state in order to use a lot of glucose, and also convert a lot of it into storage forms. these storage forms include fats and proteins, and the synthesis of other proteins will also be stimulated during this time. this means that your capacity to gain weight is much better during the absorptive state - which, as you can see, lasts for about four hours after a solid meal.
after that four hours, your body will have gotten most of what it can out of the meal you ate, and will enter the post-absorptive state. there's no new source of glucose being broken down, so your body now has to rely on what it has stored to maintain your blood glucose level. this means it will begin to break down the fats and proteins it has stored back into glucose - so weight loss will occur. in this state your body's cells will also use other sources of ATP where possible (minimizing use of glucose), but you can still end up burning through it pretty quickly. also note that this state stimulates the sympathetic nervous system, which produces adrenaline/epinephrine and noradrenaline/norepinephrine. the sympathetic nervous system activates whenever your body is stressed, and the hormones it releases stimulate the production of glucose from stored forms. this is probably why ultra intense exercise regimes cause significant weight loss.
the point here is that if you want to put on weight, you should aim to stay in the absorptive state. that means you should obviously eat three meals a day, but inbetween meals (say, 2-3 hours after a meal) you should also have small snacks. you'll want to get some good protein, carbohydrates, and maybe some fats, so muesli bars, eggs, or fish for example would be good choices for snacks.