When registering a US trademark, the time of submission of your specimen depends on the type of application you file with the USPTO.
There are two types of applications - "use in commerce" and "intent-to-use".
If you file a "use in commerce" application, you must attach proof that you are commercially active in the US market, i.e., that your goods and services can be accessed/purchased by your US customers. Shipping to the US is sufficient; your company does not have to be based there. There are no additional fees for specimen submission when opting for the "use in commerce" filing.
If you are not commercially active in the US market when submitting your application, you must choose the "intent-to-use" filing basis. In this case, you will be asked to provide proof of use (specimen) when your application passes the examination stage. It usually takes around a year from the submission of your application. The USPTO will request the specimens from you once the examination is finished. You will be required to pay an additional $100 per class at the time of specimen submission.
Specimens are also submitted after the trademark has been successfully registered. In the US, you are required to prove the continuous use of your trademark between 5th and 6th year of its validity by submitting the Declaration of Use. After 10 years, if you want to keep your trademark, you have to renew it. These two actions, Declarations of Use and renewal, and then repeated again and again, and each time, you have to also provide specimen to prove you are still using the brand in US commerce. Submission of Declaration of Use is priced at $225 per class; renewal is priced at $525 per class.