It takes 3 months to become a pilot and earn your private pilot license. To become an airline pilot, it takes just over two years to gain the required 1,500 hours flight time. maybe you want to check this website for more info:
If you attend a university, plan on four years of education. As far as flight time, it is possible to obtain a Restricted ATP that allows you to fly for an airline with as few as 1,000 flight hours if you meet specific criteria, such as having a bachelors with an aviation major from a recognized institution.
Now is a great time to become an airline pilot.