It depends on your level of skill. Some people can learn basic cooking techniques in as little as a week. Others may take several months or longer to feel competent enough to teach themselves how they cook.
The time taken to learn to cook will depend on who you ask. A person who has never cooked before will likely need more time to learn than someone who is a regular cook. Also, certain types of cooking require more experience than others. For instance, baking requires more knowledge than frying.
A specific technique will help you cook faster. After mastering one technique, you can move on to the next. It doesn't matter how long it takes to master a particular technique. Enjoy the process and keep practicing.