It takes about two years to become a commercial pilot, and longer if you want to fly big passenger airplanes.
A private flying license takes 40 hours of training.
A commercial pilot certificate takes 250 hours of training.
An airline transport pilot license takes 1500 more hours of training.
It takes most people between two and three years, but there are accelerated programs that can be completed in two years.