For the question:
How many years have you studied English?
does it mean studying English only or studying all courses in English?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
You can learn English even without taking English courses. If I'm asked this, I'd include my time with and without courses. I think if you just answer "5 years", people would just think you've learnt English for 5 years, with or without courses. You an also explicitly say "I've been studying English for 5 years at school A" to talk about just that one school.
Colloquially when someone says "they've been studying English" it usually means literature and language.
I would probably say "I have been studying the English language for N years" if I were to tell someone about just my ability to speak. Casually though both sentences can be used more-or-less interchangeably.