This depends on if you wish to fly “integrated” or “modular”. The modular route with a Flight Training Organisation (FTO) usually takes around 18 months to get a Frozen ATPL. A typical type rating for an airline, such as a Boeing 737 or Airbus A320 would take 6 months before you are flying passengers.
In the modular route, you complete your training at your own pace, flying when you can afford it and building your experience levels gradually. This could take you two years or five plus – it’s up to the individual.