There is no definitive answer to the question posed by the title of this post. It all depends on the following factors, among other things:
How much of the language do you want to learn? If you want to become proficient in all aspects of the language, then it’s going to take a lot longer than if you just want to learn enough to ‘get by’ when you visit a country or region where the language is spoken
Which languages do you already know? Learning a language related to your native language and/or another language you know will probably take less time than learning an unrelated language. There will be a lot of vocabulary you recognise and the grammar will be similar.
How will you be studying? Studying on your own and/or with a private tutor might be quicker than studying in a class because you can go at your own pace. If you study every day, even for only short while, you’ll probably make better and faster progress than spending a few hours a week in a class. You might make even more progress if you combine studying on your own with going to a class or having individual lessons – the class/lessons will give you the opportunity to use your language with others, and to get advice, guidance and feedback from a teacher/tutor, while studying on your own enables you to work on aspects of the language that interest you and practise the bits that you find difficult.
How motivated are you? To continue studying for as long as it takes to learn a language, you need to be well motivated, and also focused and dedicated. To motivated you are, the quicker your progress is likely to be.
According to , it takes about 300 hours for someone to go from beginner to advanced level. This works out as around a year and eight months of studying for half an hour a day, or ten months studying for an hour a day.
It took me five years of fulltime study to learn Chinese, a year and a half of which I spent in Taiwan. French and German took me seven and six years of regular study (a few hours a week) respectively. After four years studying Japanese fulltime, including four months in Japan, I could speak it fairly well, though not fluently. I’ve been learning Spanish and Welsh sporadically for about eight years and have a fairly good command of the latter, but only a fairly shaky grasp of the former. After two years of studying Irish I have a good knowledge of the language and can speak it quite well.