You can leave a gap of a about 3-4 inches (70-100 mm).
Fill the gap with gravel - you can go from coarse to fine as you go. This will ensure that there is a route for any water to drain away. If there is a lot of water you may want to go as far as installing a French Drain which has a pipe for removing the water rather than relying on percolation.
Another route is to make sure that there is a slight slope away from the wall.
Are the walls insulated? If not, do that first. Most of the heat escapes there...especially the part nearest and above the ground level.
With a fully insulated wall, you might not even need to insulate the slab. in MN we insulated our walls and then left the concrete floor as-is (stained it). Only on the coldest winter days did we need to turn on the fireplace and when we did, the slab was fine comfort-wise.
Otherwise, the most typical way to insulate the slab will be with foam board. Typically EPS or XPS with a floated plywood subfloor on top.
But if you have no intention of ever finishing the basement, maybe insulating the first floor underside might make more sense.
UPDATE
The above is valid for a house with a basement. I misread your question initially. It appears you have a floating concrete slab as your foundation. To insulate that you need insulation...either under it (preferred) or on top of it. Obviously adding insulation underneath is not practical after the fact.
The cheapest solution is likely just a new floor covering...carpet with a think pad...maybe cork, etc.
More complicated, but doable, would be to lay down EPS or XPS and then a floor on top of that. The trick there is that this will change the height of your floor...likely causing issues with doors, thresholds, cabinets, etc.
Best Answer
Back in the day, at least my day, the building code allowed for a maximum of a 1" corbel (extention).
I do not see any cracks in the photo that suggests shifting has occurred.
If there is a basement or maybe not, while the foundation is laid, or in the case of concrete, while it is poured, the top of the wall can rack out of square. The break between the lower wall and the upper gives the chance to re-square the walls. This may be a symptom of that.