As per USTravelDocs.com you cannot apply for the F-1 Visa 120 days before the expected starting date on the I-20.
Is there some similar condition for the H1B Visa or the B1/B2 Visa as well?
For the H1B visa, from USTravelDocs:
For the B1/B2, there's no real restriction as far as I can find, the only recommendation is that you apply no later than 60 days before the date of travel to ensure that it gets processed in time. Indeed the USCIS pages on B1 visas and B2 visas mention no requirement for when you can apply.