First we need to decide what you mean by "year"
The first time period you mention "365.256" is the Orbital period of the Earth. It is equal 365 days, 6 hours, 8 minutes, 38 seconds.
The second period is the tropical year, the time between two equinoxes. They are not equal because this period depends on the tilt of the Earth. As the tilt changes (called precession) the tropical year is about 20 minutes shorter than the orbital period of the Earh. Since this is the time between seasons, this is the length of the year that is more important practically, and is the basis of most calendars.
These periods do change over time. This is due to solar system dynamics. The Tropical year can change because the rate of precession is not constant.
The Orbital period also changes due to perturbations from other planets (mostly Venus and Jupiter) The Earth can gain some orbital Energy from other planets, causing it to move slightly further from the sun and increase the length of the year. It could also lose some energy, causing it to approach the sun and shorten the length of the year.
This rate of change is not constant. And over the long term the Earth sometimes gains energy and sometimes loses. Currently, the Earth is gaining energy (mostly from Jupiter) and the distance to the sun is increasing by 0.0005% each year
However if you look at the average changes over a period of 6000 years, there is almost no change in the length of the orbital period. In fact, on average over a period from 3000BCE to 3000CE the Earth has actually lost energy and the distance to the sun has dropped by 0.000003% per year. (Figures from https://ssd.jpl.nasa.gov/txt/aprx_pos_planets.pdf)
Your value of 5.5 seconds relates to the tropical year and so includes second-order precessional effects.
While these can be usefully modeled by a linear formula over 1000 years, this is just an approximation and over the longer term the actual orbit of the Earth is pretty stable.
Over the very long term (billions of years) other factors, such as loss of mass by the sun need to be considered, but that is not the cause of the short term variation in year length.