It follows the study period stated in your school's letter — there is no fixed number of years you can choose.
Nationwide (all cities)
The term follows the school letter
The NIA service guide says a study-type residence document may be issued with a residence period that matches the study period stated by the school. So the term is not a free choice: it is tied to the period your school writes down.
What fixes the period
Article 16 of the Regulations requires a letter from the enrolling institution stating the study period and other supporting documents. Someone who entered on an X1 visa submits the school's letter stating the study period plus an admission or enrolment certificate; if the details are already registered in the national management information system for international students in China, the paper documents can be waived.
Off-campus work or internship
One extra rule applies if you want to work or intern off campus. Article 22 of the Regulations requires a letter of consent from both the school and the host organisation and an annotation of the work-study or internship place and period on the residence document; without that annotation you may not work or intern off campus.