The time dilation relative to an observer at infinity is
$\rm \dot{t}=\gamma \ \surd g^{tt} = 1/\surd[(1-v^2/c^2)(1-r_s/r)(1-R_s/R)]$
where $\rm r_s$ and $\rm r$ are the Schwarzschild and surface radii of the planet, $\rm R_s$ and $\rm R$ the Schwarzschild radius of the sun and the orbital radius of the planet and $\rm v$ the orbital velocity of the planet.
So you divide Earth's $\rm \dot{t}$ by that of Mars to get the relative time dilation between the two: for the Earth we have
$\rm r_s=0.0088 \ m, \ r=6371000 \ m, \ R=1.5e11 \ m, \ v=29780 \ m/s$
and for Mars
$\rm r_s=0.00095 \ m, \ r=3396200 \ m, \ R=2.28e11 \ m, \ v=24070 \ m/s$
with the sun's $\rm R_s=2954 \ m$. That gives us
$\rm \dot{t}_{E}=1.0000000154711$ and $\rm \dot{t}_{M}=1.0000000098411$
for Earth and Mars, so we get
$\rm \dot{t}_{E}/\dot{t}_{M}=1.00000000563$
which is the factor by which the clocks on earth run slower than those on Mars (assuming the clocks on the poles so we can neglect the angle dependend rotation speeds of the planets themselves, and assuming a moment where Jupiter has the same distance to both planets so we can neglect his variable influence too. We could also introduce a 4th term in the denominator where the effects of the planets on each other are also considered by plugging in their distance to each other, but since that varies during the orbit and the effect is too small to make a noticeable difference in this scenario we don't need to overcomplicate it).
I just googled the mass, distance, radius and velocity of the planets and rounded some numbers, so for a higher precision in the solution use a higher precision in the input.