Which year? The sidereal year? The tropical year? The anomalistic year? The calendar year (and whose calendar)?
The sidereal year is the average amount of time it takes the Earth to make one complete orbit about the Sun with respect to the fixed stars. The tropical year is the amount of average amount of time between successive spring equinoxes. The tropical year is 20.4 minutes shorter than the sidereal year thanks to axial precession. The anomalistic year is the average amount of time between successive perihelion passages. The anomalistic year is 4.7 minutes longer than the sidereal year thanks to apsidal precession.
The tropical year, 365.24219 days, is what drives our seasons. The Julian year was an attempt to fix problems with the Roman calendar and make it more or less stay in sync with the seasons. The Romans added the concept of a leap year every four years, making the Julian year 365.25 days long. Astronomers still use the Julian year for measuring time.
The Julian calendar has a problem: It's a tiny bit too long. The Julian calendar was off by almost half a month by the 18th century, which is when many countries switched to the Gregorian calendar with its slightly more complex leap year rule. The Gregorian calendar has 97 leap days every 400 years, resulting in a year of 365.2425 days (on average). That's still a bit longer than the tropical year. It will take about 3200 years for the Gregorian calendar to be off by one day, assuming that a tropical year remains a constant length.
The Iranian calendar is a bit better than the Gregorian calendar, at least currently. The Iranian calendar has a complex formula that yields 8 leap days every 33 years, resulting in a year of 365.242424... days (on average). It will take 4300 years before the Iranian calendar is off by a day, assuming the tropical year keeps its constant length during that 4300 year interval.
Those calculations assumed a constant length tropical year. That is not the case. Perturbations by other planets make the tropical year vary. The variance works in the favor of the Gregorian calendar. It will take about 4000 years before the Gregorian calendar is off by a day, and by then the Iranian calendar will be off by a bit more than a day.
There are other years as well. Some countries use a lunar based year rather than a solar year.