It's ongoing. At a pretty young age (like 7 or something) I learned how to do some basic stuff like cook pasta and beans on the hob, make toast, put things in the oven for the time it says on the packet etc. Since then I've learned how to do other things like stir-fry, curry, lasagne, soup from scratch, risotto, following recipes reasonably well, working out how long something needs to be cooked for. I still haven't (and probably never will) learned how to do more complex things.
By teens I would have been capable of following basic recipes or throwing together basic ingredients. Never did much and the results won't have been perfect, but I would be able to feed myself.
If you're wanting to learn how to do more stuff youtube is a pretty decent tool. And it helps to remember that cooking isn't an exact art. Most things can be adapted and will survive a bit of screw ups so it's very much a think you can learn by doing.