Normally 4 to 5 years for an adult to get their Blackbelt. But this entirely depends on (a) you (the student), (b) the type of Karate or Martial Arts you choose, (c) the amount you train each week, and (d) your age.
For example, in Karate, if you train 2 to 3 times a week for 2-3 hrs each session consistently it is likely to take approximately 3 to 4 years. But if you train 1 to 2 times a week for 1-2 hrs each session consistently it is likely to take approximately 5 to 6 years.
So it really depends on how much you train, how well you listen and learn, and how focused you are. So to sum up the more you 'consistently train' the quicker you get your blackbelt.
For (a), (b), (c) and (d) see what it takes to be a blackbelt in Shotokan Karate.