These are known as bothies. A bothy is a basic shelter, usually in a remote location. They are unlocked, and available for anyone to use, free of charge.
There are many different styles and sizes of bothies. A lot of them are old cottages, others are purpose-built wooden huts.
Guirdil bothy, on the Isle of Rùm. Photo from Geograph, by Calum McRoberts, CC-BY-SA
Many bothies are maintained by the Mountain Bothies Association. They look after about 100 bothies. Most of these are in the highlands of Scotland, but there's also some in Southern Scotland, Northern England, and Wales. The MBA have a map of the bothies on their website.
Bothy Photo Gallery.
There are also some other (non-MBA) bothies. These may be maintained by the estates, or other groups. But they can be harder to find, if they are not publicly listed.
The Beehive Bothy, on the Southern Upland Way. Photo from Geograph, by Brian Barclay, CC-BY-SA
The facilities in a bothy can vary, but they are usually pretty basic. You have to take your own sleeping bag and mat, plus any cooking equipment etc. Some bothies have a fireplace, but you may need to carry in fuel.
The Mountain Bothies Association have produced a "bothy code". This has guidance for what to do at the bothy, to act responsibly, and avoid making a mess etc.