USCIS is the Federal Agency that deals with immigration. If you are an international student or an exchange visitor, you will have to contact the USCIS for information about the US immigration process. Similarly, if you need to change your immigration status while in the United States on some other visa or if you need to become a US citizen, you will have to work with the USCIS.
If you are in the United States on a valid non-immigrant visa and if you had entered into the country for tourism or for some other purpose and if you are interested in attending school while in the country on some other visa, you will have to contact the USCIS and file few forms. In order to change your status, you need to file the USCIS Form I-539, Application to Extend/Change Non-immigrant Status. If you hold M or F student visas and if you are in your senior year, to extend your stay, you will have to file Form I-539.
Similarly, if you are allowed to change your status to H-1B, you can start working in the country after completing your course. Your prospective employer will have to file a petition on your behalf, if you wish to change your status to H-1B and work in the United States and the sponsoring US employer will have to file Form I-129, Petition for a Non-immigrant Worker.
You will also be allowed to work in the country while you are still studying and to work while you are studying, you need to file the USCIS Form I-765, Application for Employment Authorization. USCIS will mail you Form I-766, Employment Authorization Document, after your application is approved. You may use this employment authorization document to work legally for US employers and remember that you cannot work legally until you receive your EAD card.
Apart from off-campus employment, if you are a STEM graduate, you will become eligible to remain in the country for 17 more months and you may apply for Optional Practical Training STEM extension for 17 months, after completing your course. After approving your petition, USCIS will grant you an employment authorization document, with which you can work in America.