How did they decide the length of one year even though it wasn't known that earth revolves around the sun? It takes one year for the earth to go around the sun, but one year was already this long when they didn't even know that the earth revolves around the sun at all. So how did they figure it out?
Originally a year would be noticed as the time between two winters (or two harvests, two annual floods etc), although the exact number of days might not be known with any accuracy. 

As people start to observe the sun more carefully, it would be noticed that the position of sunrise and sunset move regularly. Stonehenge and other ancient monuments seem aligned to midwinter sunset or midsummer sunrise. Since this would allow one to predict the seasons, it would have been very useful.

More careful observations led to the geocentric model, in which the sun takes just over 365 days to move around the Earth once relative to the background stars. The length of the year was known to be about 365.25 days since the times of the ancient Egyptians.