If your request for H3 visa has been approved by the United States Citizenship and Immigration Services (USCIS), you as a trainee will be permitted to stay in the U.S. for a maximum period of two years. If your trainee petition is granted by USCIS for a special education exchange visitor then you may stay in the U.S. for a period up to 18 months.
Duration of H3 visa can not be extended. You have to leave the U.S. after expiry of the last date of the authorized stay. If you have already resided maximum period of permitted time in the U.S. you may not be eligible to request for change of status, extension, or readmission to the United States in H or L visa status until you have stayed outside of the U.S. for at least duration of six months.
However, during the training, if you are taking up a job your employer may apply for a change of status for you by filing Form I-129, Petition for Nonimmigrant employee, at the USCIS Regional Service Center. The consulate will scrutinize your case and accordingly the visa status will be changed to either H1B or TN. However, be sure that the sponsor includes your dependents on Form I-539 i.e. request to extend or change non-immigrant status.
Before the duration of H3 visa ends, you can travel outside of the U.S. number of times you want. The USCIS does not have any restriction on your stay in a foreign country.