Hi @m,
This question is a bit like “How long is a piece of string?” :)
Ear training is a huge and varied topic and so it really depends exactly what your goals are.
You’re not the only one wondering though – more info in this FAQ.
If you choose a specific goal, then it’s possible to estimate the time it will require, but even then it will depend a lot on how much you practice, how often you practice, how carefully you practice, and what training resources you have to help you practice.
To address your specific example of learning perfect pitch…
You can certainly learn a reference pitch in a month or two if you’re dedicated. You might be able to pick up a handful of notes on a particular instrument (e.g. mid-range C, D, E, F, G on piano) Learning to reliably identify each of the 12 chromas by ear in 3 months is probably too ambitious.
This is a tricky one to choose as the example though, because it’s one of the most challenging skills to develop, and the patience required is too much for most people who start. That’s why we recommend studying relative pitch instead, which lets you attain most of the same musical skills but is far more rewarding along the way.