Calories are a useful approximation, but not how humans actually operate. A Bomb Calorimeter burns material and the resultant heat generated is what we call a calorie. As a illustrative example of the difference - gasoline is very calorie dense, but not helpful if eaten by a human.
do I gain the calories over the next few hours? Or is it delayed a day or two?
The human body will break down all food and drink into its base components then decide what it will keep, what it will excrete (more or less). So when you consume something you "gain" it immediately (its in your system), the time until its used in the body could be minutes (like carbohydrates), hours (fibre), etc. Often the body will decide to store any excess (carbs again) for later use (weight gain).
Because there will be days when I eat almost NOTHING, and then my scale says I gained 3 lbs. But then there’s other days where I feel I ate like a slob, and somehow lost 2 lbs.
The human body is an amazing homeostatic machine, it's trying to self regulate to optimal body composition. The trouble is lots of modern western food messes with the bodies ability to self regulate..... which brings us to the real topic
Losing weight is hard, but it might be easier if I understood the rules of how this all works.
The big secret is hormones, don't interfere with your hormones and the body will self regulate body composition to optimal (lose weight if your obese).
[Paper] The Carbohydrate-Insulin Model of Obesity - Beyond “Calories In, Calories Out” - 2018
TLDR - Eating sugar and carbohydrates forces blood glucose levels to rise (within minutes), elevated blood glucose forces insulin to rise (to reduce blood glucose), elevated insulin forces the body to go into anabolic (gain weight) state. Basically you can't lose any fat while your insulin is high, so every time someone eats a bunch of sugar or carbohydrates with a meal/snack they are putting a 2-4 hour pause on any fat loss.