Grammar books set rules for ELL when they want to ask questions to use present perfect form for counting, and present perfect progressive for periods of time.
Now what if you want to ask about a period of time in years, i.e. the question is a counting and a period at the same time? Does the question below sound natural or awkward?
Present Perfect Progressive:
How long have you been married? (this is OK)
(How many years) have you been married for? (Is it OK?)
Present Perfect:
(How many years) have you studied English? (Is it OK?)
If none is OK, how would you ask otherwise if you want the answer in years?
Best Answer
I think your questions are both OK. Your only mistake is that you mention the Present Perfect Progressive (also called the Present Perfect Continuous) but you don't use it.
When inquiring about periods of time regarding activities that still occur/are still true (and are not completed), the right approach in English is always a Present Perfect tense. Whether that be Continuous (+ing) or Simple (+ past participle) (and if the action is completed, but we don't know when), depends on the verb. State verbs (like "be" in your first example) can only be employed using Present Perfect Simple, whilst action verbs (like "study" in your second example) can be employed in PPS/PPC. Using PPC gives your sentence/question that emphasis of "repeated/continuous" activity, but is not mandatory. So:
Is just as worthy as:
(The same applies to your first example too)
Which brings us to your question of how to phrase your query if you wish to receive an answer using a specific "time reference" (ie "years" in your example). Generally speaking, the native English speaker will likely not worry about the "time" part of the question too much, leaving the listener to respond in the most logical way. In your example, this would likely be in years, or possibly:
Of course, sometimes specificity is needed or desired as in your question. If you don't want "since I was 5" type answers, then you need to "lead" the listener, by encouraging them to respond according to the "time" part of the question you use.
Etc.
Consider this last example of a situation where a specific (maybe overly?) response is needed.
A manager has to enter a candidate's information into the following box on their computer during a job interview: Years of higher education studies completed: [ ]
The manager will obviously require a response in years, and so will need to ask his question accordingly:
Note the use of PPS for the "finished action".
Or, if the candidate is still studying:
Naturally, my examples work just as well with a more general "time query" (ie "How long?") if the answer doesn't need to be specific.
I hope that answers your question fairly well. Maybe I went into too much detail on PPS/PPC and confused you (I hope not!). As a final observation, I think your first question reads more naturally without "for".