How many years have you been studying Japanese?
How many years has it been since you started living here?
what year
Asks for a specific calendar year, school year, fiscal year, or year in a timeline, rather than a duration.
What year was he born?
What year were the Tokyo Olympics held?
He has been working at the same company for many years.
Do you remember what year that incident happened in?
How many years have you lived in Tokyo?
May I ask, what year were you born in?
何年 asks about a number of years (duration) or a calendar year, while 何歳 specifically asks a person's age.
いつ is a general question word for 'when', whereas 何年 narrows the question to a specific year or number of years.
何年 asks or expresses an unknown number of years ('how many years'), while 数年 states a definite, small, but unspecified number of years.
Transparent compound of 何, the interrogative 'what/how many,' and 年, 'year.' The reading なんねん is the regular counter-like reading used when asking about years.