An H-1B visa is issued for up to 3 years (5 years in the case of H-1B visas based on services for DOD projects),
and you are able to extended it for up to 3 years (5 years for DOD projects), for a total of 6 years (10 years for DOD projects) of continuous employment in the U.S. If you wish to stay in the U.S. longer than 6 years (10 years for DOD projects), you will need to qualify for another visa or apply for permanent residency.
In order to extend your H-1B visa, your employer must repeat the same process as what it went through for your original H-1B visa. Your employer must file Form ETA-9035E Labor Condition Application with the Department of Labor, and then file Form I-129 petition to extend your H-1B visa with USCIS before your original petition’s validity period expires.
After your employer files an extension petition on a timely basis, you can continue to work in the U.S. for the same employer for up to 240 days after your original visa has expired, while you wait for the petition to be approved. However, if USCIS denies your extension petition, then you must immediately cease your employment in the U.S. and depart the U.S.