What is the highest level of German one can realistically achieve without living in a German-speaking country?

I would guess you obviously can't reach a native level ... I know some people who lived in Germany for several years and took intensive courses who still can't speak it fluently.

So yeah as the title poses, what is your guess? And how long would it take to reach that level? What can one do to master the German language as well as possible while not living in a place where people commonly speak German?