It's not that easy to work while studying in the United States as the government has placed restrictions on work done by international students.
Working part-time in the U.S as an international student can get complicated really fast. You must therefore learn the legal requirements and be prepared to follow the conditions of your visa. In the main, as an international student you must maintain full-time status at all times. In addition:
To be considered on-campus employment, the work you intend to do must meet the following criteria:
Exceptions may be made by the Department of Homeland Security (or DHS) in certain cases but if you have to work off-campus, you will have to apply for work authorization from USCIS. Approval is on a case-by-case basis.
If you don't qualify to apply for Off-campus work authorization, just check your curriculum to see if practical training is has been incorporated into your program. You must consider though that not all work done under CPT is paid.
OPT employment may provide you with an opportunity to gain one year of paid work experience in the U.S. in the field of your study. Many students choose to apply for OPT after they graduate with a certificate or Associate's, Bachelor's, Master's or Doctorate degree.
You may qualify for the additional 24 months of training/employment in the OPT STEM Extension if your program is listed in the STEM Designated Degree Program List. This means a total of 36 months paid work after graduation provided you meet the criteria.
H-1B Working Visa, Cap-gap Extension
Basically, the cap-gap extension bridges the gap between the end of your F-1 status and the start of your H-1B status. This allows you to remain and work in the U.S. during the "gap."
We recommend reading the entire article, Options to Work While Studying in the U.S. as well as the US Student Visas: Overview and Important Information to gain a better understanding of studying in the U.S. as an international student.