How to select the resistance value for an Arduino capacitance meter
It is usually desirable to maximize the resistance in order to be able measure relatively small capacitance values.
The ATmega328P datasheet says:

&quot;The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less.

.. and then goes on to describe the effect on the sampling time. The leakage current is also a potential issue.
That does not mean that one could not use less or more resistance in some given situation, with careful analysis, but it's a reasonable starting point.
For example, to measure a 10,000 µF capacitor, 10 kΩ may be too large (\$\tau\$ = 100 seconds). However, if you go too low in resistance then the output resistance of the GPIO pins will start to affect the time constant.