analogRead. When does it take the sample.

Not quite, you just describe how single-slope ADC works.
Datasheet:

The ATmega328P features a 10-bit successive approximation ADC.

Successive approximation ADC take a sample fast and hold it, than uses DAC to measure voltage.

The ADC contains a Sample and Hold circuit which ensures that the input voltage to the ADC is held at a constant level during conversion

And there is a link: