Explanation:
the "speed" or productivity he showed was
9 kg / 3 hours = 9/3 kg/h = 3 kg/h
with the same "speed" he is now preparing 24 kg. that means the ratio between kg and hours must still be the same :
24 kg / x hours = 3 kg / 1 hour
24/x = 3
24 = 3x
x = 24/3 = 8 hours
Charlie worked 8 hours to prepare 24 kg of dough.