Um... possibly soon after birth (or maybe even in utero, which apparently has been reported before).
I certainly know I was masturbating at 3, and already felt that I had been masturbating for some time.
My parents were fine with telling me where babies came from (when I asked, at the age of 2), and I think I figured out most of the mechanics for myself - but I was a very curious kid who learned fast. So far as I remember, I always incorporated sexual fantasy into my masturbation. I wasn't abused or anything, but I quickly linked sex and masturbation in my head.