What was the length of year 1 million years back? We know that the universe is gradually expanding and this indirectly means that the gravitational force between sun, earth, planets and other stars (roughly anything in the universe) is gradually decreasing as gravitational force is indirectly proportional to square of distance between the objects.

So I think this also effects to length of the year. If yes then is it possible to know how days does 1 year had 1 million year back?
The Hubble expansion has no bearing whatsoever on the length of the year. This is because the whole Milky Way galaxy (and in fact most galaxies, if not all, and even local groups) has decoupled from the Hubble flow long ago. In fact, it could only form after it decoupled. Note that M31, our sister galaxy, is in fact falling onto the Milky Way rather than receding (as the Hubble flow would imply), demonstrating that the whole of the Local Group (of galaxies) is decoupled from the Hubble flow.

What happens is that any over-density expands at less than the Hubble rate and thereby grows. Galaxies (and larger structures) form from small relative over-densities that eventually grow large enough to withstand the overall expansion and instead collapse under their own gravity to form bound objects, such as galaxy clusters, galaxies, star clusters, and stars. This implies that the Hubble flow has no bearing on the inner dynamics of such systems.

Of course, the number of days in a year was higher in the past than today, but that is only because the Earth is spinning down (due to tidal friction with the Moon), so that the days become longer.

If anything has had an effect on the semi-major axis of the Earth orbit (and hence on its period), then that is gravitational interactions with the other planets. However, weak interactions (secular perturbations) can only alter the orbital eccentricity and leave the semi-major axis unaltered.

Finally, there is a tiny effect from the Sun loosing mass (to the Solar wind). The period of any orbiting bodies is proportional to $M_\odot^{-1/2}$.