Sleeping with a hot-water bottle is an extremely efficient and relatively safe way to deliver heat to your bed — no heat is wasted on warming up the air, your mattress, or the walls. It just slowly leaks out through your blankets.
It's also relatively safe, in that it is very unlikely to cause a fire (unlike a malfunctioning electric blanket, space heater, or kerosene or wood stove). And it can effectively harness abundant low-grade solar heat, such as from flat-plate collectors.
A traditional approach is to fill a rubber hot-water bottle of 1ℓ or so with boiling water, which is somewhat dangerous; sooner or later the rubber will crack and the hot water will escape, and if this happens rapidly while the water is still near to boiling, it can seriously fuck you up. Also, the rubber hot-water bottle is somewhat expensive, so many houses only have zero or one of them, even in otherwise economically developed countries.
A cheaper alternative is to fill discarded PET bottles with hot water, well below PET’s usual softening point of 90°. The PCO1810 and PCO1881 caps normally used on soft-drink bottles are easy to secure, resilient to pressure, abrasion, and impact, and very reliable, although for extended warm use, I trust the gasketless all-polypropylene caps more than the caps with a separate gasket inserted into the cap. The water need not be potable, although it’s probably a safer situation if it is potable, in case someone drinks it by accident or in desperation.
The energy provided by a hot-water bottle is proportional to its mass and to its ΔT above your body temperature. Sooner or later, under the blankets, your skin will reach nearly 37°, so that's the reference point; a bottle at 38° has, in effect, half the energy of the same bottle at 39°.
Up to about 45° there is no real hazard from hot water under normal circumstances; if it does leak, it can burn you, but slowly enough that your instincts will probably protect you adequately. I think 50° is probably a good balance point between burn severity and energy capacity, even though PET can handle temperatures up to 80° with ease.
People generate about 100 watts each (2000 kcal/day = 97 W), so sleeping with a 100-watt hot-water bottle should warm you up about as much as sleeping with another person, which is pretty comfortable on nights ranging from cool to quite cold. More, perhaps, since it is hot enough for heat to flow from it into your body, rather than just stopping the heat loss from one side of your body.
So how much water would you need to be really luxuriously warm, say, 300W for 8 hours? That’s 8640 kJ or 2063 kcal (which should be unsurprising, given the 1 person ≈ 100 W equation in the previous paragraph) which requires 159 kg of water at ΔT = 50° - 37° = 13 K.
This is a dismayingly large number, 53 3ℓ bottles. If you go up to 80°, you get down to 48ℓ, 16 3ℓ bottles, at the expense of potentially serious scalding if one of the bottles springs a leak. A 1ℓ bottle starting at 100° only averages 13 watts over 8 hours, though it can provide over 100 watts for 1 hour if its insulation is thin enough.
I conclude that phase-change materials like Glauber’s salt (is its freezing point high enough?) and active thermostats like the ones in waterbeds are a more practical ways to warm up your bed, and hot-water bottles are more a question of comfort than of actual temperature control.