How long does it actually take to learn Mandarin Chinese? I'm not going to define what fluent, but how long does it take to pass the HSK6 for example? The HSK6 is the highest Chinese Proficiency Test for foreigners at the moment.
Here is an example from one of my students.
Her first Chinese course was a month-long travel Chinese course when she was 16. She was already very interested in learning the language on her own then, she only started to get more serious with Chinese when she enrolled to the Chinese course. For two semesters she had four hours of Chinese every week. During Summer and Autumn 2009 she had only two hours of Chinese lessons a week.
When she came to China this is what she could do: introduce herself, ask for directions, buy things, order in a restaurant. But she often found it hard to understand what the locals were saying. She could write maybe 200 characters by hand when she came.
Then she enrolled in Shenzhen University and spend two and a half semesters there. Spring 2010 she failed the old Elementary-Intermediate HSK exam, but in December she got to the level 4 of old HSK. And then passed the HSK5 during spring 2011.
She changed to another private institution in September 2011 and passed HSK5 in December. In April 2013 she passed HSK6, 238 points out of 300.
Based on her experiences learning Chinese, I would guess that you can also get to HSK6 in about 4 years in China.
Of course you can't learn Chinese simply just by being in China. Here are some advices to follow based on both my teaching experience and my students' feedbacks;
1. Enroll in a university, language courses or be a very diligent self-studying type.
2. Almost always do your homework and study extra on your own.
3. Take the HSK every year in order to see your progress.
4. Make Chinese friends or have a Chinese boyfriend/girlfriend, someone to talk to everyday in Chinese.
5. Do your best in watching Chinese TV series and movies.
6. Also do your best in reading Chinese books.
It's really not about HOW LONG you study, but about HOW MUCH you study. These sounds so obvious, but yet so many people fail to realize you really need to put on the time. I think this is especially true for most people studying Chinese since it is probably radically different from their mother tongue. It's really hard to go to Chinese and just 'pick up' the language. You really have to put in the time and effort.
So I think for the average person, four years (and studying rather hard) in China is a good guesstimation for how long it would take to pass the HSK.