It has to be to do with the lengthening of the sound waves - the longer they are, the deeper the note.
That isn't correct, as it could be to do with the change in the speed of sound. The formula is v = f • λ, where v is the velocity, f is the frequency λ is the wavelength, and what I think is happening here is that the speed of sound is varying, which seems far more likely than the wavelength varying.
(If the speed of sound were fixed, because the medium were fixed, then there would have to be a change in dimension. That is how the notes of wind instruments are changed, as they all work with air)
There are two possible mechanisms that I can see.
1) It could be due to the heating distribution within the walls of the mug. The chocolate heats the cup from the inside, while air cools it from the outside. Stationary hot chocolate is a worse conductor of heat than moving hot chocolate, so there will be less heat loss and as smaller temperature difference between the inner surface of the mug and the outer surface, so less stress in the material. When the chocolate is stirred, more heat is transferred to the mug, so the is a bigger temperature difference, and more stress in the material. The more stress in the material of the cup, the stiffer it becomes, raising the note.
2) Air entrapment in the hot chocolate lowers the speed of sound in the liquid. It only needs a tiny volume of air to lower the speed enough if that is the mechanism. The formula for speed of sound in a fluid is:-
where:
K is a coefficient of stiffness, the bulk modulus (or the modulus of bulk elasticity for gases);
ρ is the density.
Now liquids are not very compressible, so K for them is very high, so high that the speed of sound in water is around 5 times that in air, in spite of the fact that water is around 800 times as dense as air, water being around 15,000 times harder to compress than air.
So a tiny amount of air in the hot chocolate will lower the stiffness lots (think of small air bubbles in hydraulic brakes) and will therefore lower the speed of sound by enough to be heard.
(As a demonstration of the huge reduction in the speed of sound that air in a fluid can have, hold a full tub of Swarfega in one hand and tap the tub with the other hand. The tub will wobble. Swarfega is largely water, but has air bubbles in it, so its density is nearly as high as water, but its stiffness is really low, due to all the bubbles. The result is a speed of sound as low as few m/s, and the wobble is the shock of it being hit reflecting off each side, and doing so slowly enough to be felt, far too slowly to be heard)