I've always taken it for granted that I know the general layout of the entire planet, and certainly the layout of my country and my continent. But how much would someone in the distant past know about that?
For example, would someone living in some small town or village in the middle ages (or earlier) know where the capital of their country is? Or the rough shape and size of their nation? If they didn't, how would they go about finding it out? Were there maps they could access at a library?
I am sure it depends on which location in particular you are talking about, but I can comment on villagers in Romania during the 13-15th centuries. These villagers did know what the capital was. This was likely from the fact that they were well versed in who the ruling Prince was and different rulers visited the surrounding towns. Also, depending on whether the town was located on the Danube or not, many villagers were traders with Turks and Hungarians. I cannot comment on maps, but these villagers certainly knew that Muslims were coming from the East and Christians from the West. They knew where the capital of their Principality was located and often were forced to visit to supply tribute (whether monetary, rations, or giving away of young boys for conscription).
Dracula: A Biography of Vlad the Impaler 1431-1476, by Radu Florescu, Raymond T. McNally
A lot would depend on how you define 'surrounding': I'm sure most peasants would know the nearest few miles surrounding their countryside very well. Beyond the closest market, however, it's unlikely that they really thought about their geography in the same way as you're asking about. Medieval and ancient people thought about space and geography in very different terms than we do now: where we tend to think about spaces on a map (made-to-scale), which are coloured in and belong to certain town/cities/kingdoms, it seem that medieval man would have thought of space in a much more linear way. See the excellent post here about how medieval soldiers would find their way around in foreign lands or the post here which shows a medieval copy of a Roman map designed not to show the rough shape and size of the world, but how to get around within it. So while a medieval peasant might know that the Kings spent most of his time in Paris and that Paris was thataway, he may well not have seen the point in spending time and effort drawing it to-scale from a birds eye view.
There were maps, of course, that were similar to what we have today, such as the Hereford mappa mundi and these were kinda-sorta accurate and gave a rough idea of where things were, but they were prestige items and would not have every been available to peasants.