Ahhhh... I get this question A LOT!!!!
Well... you may not like this answer, but there really is no prescribed length of time that I can definitely tell you.
All I can say is this, it's based on a number of factors (which I'll outline next!), and that at the outset, I usually budget anywhere between 12 and 16 weeks to help an actor master a dialect.
So what are the determining factors?
1) Are you an actor that has a lot of experience with dialects and voice and speech, or do you have little or no experience?
This is perhaps the most important factor in how long it will take you to master a dialect. This is because the part of learning a dialect that takes the most time is actually made of two parts: 1) How to go about learning a new dialect or accent. Essentially, do you know how to learn a dialect (I guess I should say, the processes and homework involved)? And 2) Integrating the dialect into your acting work. This means LITERALLY imprinting the dialect into your brain so that you can think and speak at will in the accent.
If you have lots of experience and already have the tools in your actor's toolbox to be able to more quickly assimilate a new dialect, then this part of the process tightens up quite a bit.
You'll know how to make connections and do work on your own that will speed up your mastery a lot!
However, if you have little or no experience then your dialect coach will need to teach you some of the tools that will ultimately make learning a dialect easier for you both now and in the future.
IMPORTANT NOTE!!!! - it's not out of the world of possibility that you may be given little to no notice for an audition or role for which you need a dialect. Don't despair if you are inexperienced in accents (or even if you have lots of experience). As a dialect coach, I have lots of tools and ways of working that'll help us get there faster, though sacrificing some of the in-depth work.
The times when an accent or dialect doesn't work for an actor in film or TV are the times when I CAN GUARANTEE, the actor was not given enough prep time to really master the dialect.
2) Is the dialect close to or far away from the way you speak in everyday life - what I call your "Native Dialect"?
Just a reminder here - you already come pre-loaded with an accent!
This can go either way. It all depends on your proclivities and how you best learn. Some actors do much better when an accent is far, far away from the way they naturally speak. Some do better when it's closer to how they normally speak. It all depends on you, and this will affect how long the process takes. The point is that we want to shed your Native Dialect and completely assume the target dialect... I wish I had a better answer for you than "It depends on how you best learn," but I don't! This is actually a part of the process that really excites me as a dialect coach!!!!
3) How much work are you willing to put in outside of your sessions with your dialect coach?
You'll probably have 1-3 sessions a week with your dialect coach, depending on the project and budget. You can get a lot done in those sessions, but since the hardest part of learning any dialect is imprinting it in your brain so you can think and speak extemporaneously in that dialect (rather than just saying the lines you have to memorize), you have to put in a lot of work on you own time.
Think of this like training for a role as a big mountain climber. You wouldn't want to look like you had no idea how to tie a figure-eight knot, or belay a climber, or attach protection to a rock face, would you? Of course not! You'd practice these things with a coach and on your own to get it in your bones so it becomes second nature! You have to practice and drill a dialect in the same way. Your dialect coach will have lots of cool, creative, and above all, FUN ways for you to do this.
They may give you recorded samples to listen to and repeat in the car.. if you're lucky they'll do your lines!! You may have word lists with sounds that you struggle with and you'll have to repeat over, and over, and over, and over. You may get flash cards, or a movie or TV show to watch and listen to an actor, or even an actual person to have a conversation with and watch his or her accent in action!!! There are too many fun ways to help an actor master a dialect to list here!!!!
One of my pet peeves is when dialect work - which is potentially extremely hard - is made into a chore and all the fun is taken out of it. If you enjoy exploring the different psychological and emotional facets of your characters, then dialect work fits right into that. Dialects are literal vocal projections of all that psychology and emotion, so have FUN exploring!!!
There are more factors that'll influence how long it takes to learn a dialect, but these three are, in my opinion, the three most important.
Above all... HAVE FUN!!!
Anyway... Those are my thoughts!