Different points in the earth are at slightly different distances from the sun and hence, experience different forces due to gravitation.
For a rigid body, we know that, if various forces act at various points in it, the resultant motion is as if a net force acts on the CM (centre of mass) causing translation and a net torque at the CM causing rotation around an axis through the CM. For the earth-sun system (approximating the earth as a uniform density sphere) [NCERT Exemplar]
As the earth is revolving around the sun in a circular motion due to gravitational attraction. The force of attraction will be of radial nature, i.e. angle between position vector r and force F is zero.
So, torque,