Difficult to answer! We have a complicated education system in Germany. The short answer is "six years at least, but typically longer".
We have not one education system but sixteen because it's a sub-federal responsibility. We have three kinds of secondary school, Some people have had a bit of English already in primary school and some haven't (I think it's very common now or possibly universal, but I did not yet have English in our junior/elementary school equivalent). I've enjoyed nine years of English education at school, which I think is a typical timespan.
The real-world performance at adult age depends a lot on the additional exposure I would think... after school, or parallel to it. Reading books brought me forward a lot. I started with Harry Potter, and that was because the originals came out before the translations :) It was important for me to know whether Harry gets Cho! The English lessons focused on high culture, which is boring. I'd have preferred either something more entertaining, or something more practical (writing business e-mails and such).