Whenever the space race is discussed it seems like there is two sides who are very convinced that either the first man in space or first man on the moon made either side win the space race. In the west it seems that the US won it when they landed on the moon. But when I have talked to Russians it is not really a question of winning or losing, just an amazing thing that Gagarin went into space.
So, I wonder if it was as clear then as it is today in both the west and the east that there was a set finish line for this race, and that someone won it with any of the milestones.
This is a really good question! Sadly, the short answer is that, well, as you alluded to, it was for the US and it wasn't for the Soviets. I have an answer to a different question about why we say the US won the space race at all here, so if you're interested I would recommend the whole thing. But to sum up the part that's relevant to this, the United States government specifically portrayed the moon as the ultimate goal of the race once people in positions of power realized that NASA probably wouldn't have a chance at beating the Soviets to most low-Earth orbit achievements.
That, of course, raises the question that I answered in the other thread I linked about why the US was able to beat the USSR to the moon at all. I recommend you just go read my other answer, but basically Soviet industry and the Soviet economy weren't able to keep up with the US' ability to keep investing in spaceflight in the long term, and the resource shortages led to delays, which were worsened by infighting between design teams within the rather decentralized and disorganized Soviet space effort. The key piece, though, is that when NASA realized that they were "behind", they responded by getting started on lunar development simultaneously with low-Earth orbit development because they could do it economically, and then incorporated the idea that the moon was the final goal into official rhetoric, such as Kennedy's famous speech at Rice (which is also really interesting if you care at all about the connection between space and the idea of the frontier and expansionism/Manifest Destiny in American culture, but that's a whole other topic).
Anyways, if you'll indulge me in a little copy-pasting from my earlier post just to save my fingers a little:
The United States started to plan for a moon mission earlier, and the binary between orbital missions and lunar missions is an important one. Part of the reason for that is that American leaders realized in the late 1950s that the US probably would not beat the Soviets to a lot of the achievements to which they, in the event, did not beat the Soviets. As a result, the US emphasized the moon as the ultimate goal of the space race because it knew that it was a goal it had at least a chance of achieving first... We say now that the US won the space race because the people in charge of the effort got to decide, at least in the American public consciousness, what counted as winning. And indeed, in Russia, the lunar effort is seen as a much smaller part of the larger period, and certainly not as the single qualifier for victory.
...
In the Soviet program, on the other hand, plans for a serious lunar rocket did not get underway until 1964. Although Soviet propaganda accented the dream of a peaceful socialist utopia in space, the leadership of the USSR knew that the USA had many more nuclear missiles than they did, and they strove to achieve parity in the number of rockets they could field. As a result, the USSR primarily financed the construction of nuclear missiles, which were indeed very similar in design to their low-earth-orbit lifters, but quite dissimilar to the kind of rockets needed to land on the moon.
In the case of the Soviet Union, this focus on space as a means to achieve socialism meant that the moon was still very important as a potential base, and as a place to start a new socialist society, but even apart from the fact that the Soviet designers knew they were falling "behind", it simply wouldn't have fit with the rest of the propaganda to turn the moon into the only criterium for victory. The emphasis in Soviet propaganda was more on space as a realm of infinite possibility than as a concrete racetrack with a well-defined goalpost. If American propaganda drew from the drive to the pacific coast, where the final destination defined the journey, Soviet propaganda drew more from a revolutionary teleology, from "building socialism", where there was a single great break with the past, in the form of Gagarin's flight, and a beautiful new age as a result. A moon landing, although it is obviously a great achievement, doesn't quite match the socialist historiography of a new age. I somehow suspect that, even if the USSR could have beaten the US to the moon, they still would have kept most of their propaganda about Gagarin and the waiting utopia offered by the era he ushered in.
I hope I haven't restated too much of what you already know back at you here, and to be honest I could stand to do some more research on how and when exactly it was decided in the US to frame the moon as the goal, and who exactly was responsible. But the main point is, this idea of the moon as the ultimate aim of the US space program is very much an artificial narrative that was intended to provide propaganda victories, but it was at least not retroactive revisionist propaganda — it was definitely contemporary and already present at the time of the space race.