You know that gravitational force varies directly with the product of masses and inversely with the distance between the two masses.
So, while calculating the force, we need to keep in mind both mass and distance.
If you go on decreasing the distance keeping the masses constant, the force will keep on increasing. As you decrease the distance, the volume of objects will decrease. But after sometime, you can no more decrease the distance because an object with mass cannot have 0 volume. So the distance between the masses can't be 0 and hence force will not be infinity.