It depends on you. For me, it took 6months of learning from the scratch and one month of exam préparation. All together, it was 7months. My learning was highly intensive as i had all the time to do it. Beyond learning the grammar and vocabulary, i networked extensively online and surrounded myself with francophones. That really helped.
Secondly, i was highly motivated. I saw it as the only means to get permanent residency of an advanced country. I was 37 at the time and gave it my all. I fell in love with french even beyond TEF Canada. At some point, it wasn't even about the exams anymore.
So it all depends on your motivation and the time available to you.