This has everything to do with the heat setting or the “burn rate” on your stove or insert.
One pound of wood pellets will produce approximately 8,000 BTUs of heat. So, if you are burning pellets on the “low” setting, say 1 ½ lb./hour (or 12,000 BTU), a bag will last about 26 hours. (40 lbs. divided by 1.5 lbs./hour = 26.67 hours.)
If you need a lot of heat, burning five pounds per hour (8,000 BTU x 5 lbs./hour = 40,000 BTU), one bag will last about 8 hours. (40 lbs. divided by 5 lbs./hour = 8 hours.)
Manufacturers will publish the “burn rate vs. BTU output” data in their product literature and the owner’s manual.
Pellet equipment has various settings, depending on how cold it is outside and the amount of heat you need to stay comfortable. If your stove operates on a thermostat, the burn rate will automatically vary depending on the temperature setting.