The strength of a gravity pull between two bodies is proportional to their mass and inversely proportional to their distance. Since the distance here is fixed, the only thing that will affect it is the bodies' mass. Since the sun is a fixed mass here, the only thing that will matter now is the mass of the planet