As soon as possible. The amount of time it takes to interview and process a visa varies greatly. Estimated wait and processing times can be found here: https://travel.state.gov/content/travel/en/us-visas/visa-information-resources/wait-times.html
If you are applying for an O or P visa, you must first have your petition approved by USCIS (see here: https://travel.state.gov/content/travel/en/us-visas/employment/temporary-worker-visas.html). Petition approval may take as long as 180 days.