Royal mansions in the UK
The phrase covers three quite different sorts of building, and most confusion about royal houses comes from running them together. There are palaces the Crown built and still holds; houses the Crown built and gave away; and private houses that were never royal at all but which took a monarch in for a night or a week and have traded on it ever since.
Palaces the Crown still holds
The occupied royal palaces are a short list: Buckingham Palace, Windsor Castle, the palace of Holyroodhouse, St James's, Kensington and Hillsborough. They are held in trust for the nation, not owned personally, so they cannot be sold and their maintenance is a parliamentary matter. Sandringham and Balmoral are the exceptions: those are private property, bought with private money, and they behave like any other large estate.
Hampton Court and the Tower are in a third category again, unoccupied and run as historic sites. It is worth knowing that Hampton Court was not built by a king at all. Wolsey built it, and Henry VIII acquired it from him in circumstances that were not entirely voluntary.
Houses the Crown let go
A great many royal mansions in the UK stopped being royal. Nonsuch was demolished; Richmond Palace survives only as a gatehouse; Greenwich became a hospital and then a naval college. Others passed to favourites and became the seats of families who are still there. The pattern is consistent: royal building is enormously expensive, and monarchs who inherited too many houses disposed of them as readily as they built new ones.
For the modern equivalent of the very large private house, see the Mayfair megamansion, the same impulse, differently housed and considerably better hidden.
The houses that took kings in
Before the road system and the railway, a monarch moved around the country in a progress: a slow circuit staying at the houses of subjects, who bore the cost of feeding several hundred people. Being chosen was an honour and a serious financial event, and it is why so many medium-sized manor houses have a state bedchamber far grander than the rest of the building.
Gainsborough Old Hall is a clear example. Richard III was there in 1483 as the guest of Sir Thomas Burgh, and Henry VIII came in 1541 with Catherine Howard on the northern progress. Neither visit made the hall a royal mansion; both made it a house that had to be good enough for one, which in practice meant the great hall, the kitchen and the lodgings were built to a standard well beyond the family's day-to-day needs.
Reading the record for yourself
Household accounts, itineraries and the calendars of state papers are where progresses are actually documented, and much of that material is now scanned. Open Library holds a great deal of the older printed literature (county histories, antiquarian surveys and the nineteenth-century editions of the calendars) and archive-it.org preserves institutional sites that have since gone offline, which for local history is often the only surviving copy.
The pitfall is the Victorian county history. They are indispensable and they are frequently wrong, particularly about dates and about which monarch slept where. Treat a nineteenth-century attribution as a lead to check, and look for the primary reference behind it.
Questions about royal houses
Does the monarch own Buckingham Palace?
Not personally. The occupied royal palaces are held in right of the Crown and cannot be sold. Sandringham and Balmoral, by contrast, are private property.
What was a royal progress for?
Visibility and cost-shifting in roughly equal measure. It let the monarch be seen across the country and moved the expense of the court onto the hosts.
How reliable are "king slept here" claims?
Variable. Where an itinerary or a household account survives the claim can be checked; a great many rest on nothing more than local tradition written down in the nineteenth century.