When is the latest I can apply for H1B before OPT expiration

I have 64 days for my OPT expiration. Can I still apply for H1B visa. If yes, how much time do I have. I work for a university. Is it true that I must apply for H1B atleast 60 days befor my OPT expires.

From you question I am assuming that your University which is Cap-Exempt employer is willing to file for your in H1 - purely going by the rules you can file for your H1b even after your OPT expiry but before the 60 day grace period.In such a scenario you won’t be able to apply for a Cap-Gap extension and will have to stop working once OPT expires but can legally reside in the US till your petition has been adjudicated.Hence this would be a bad option.

On the other hand if you apply for H1b during your OPT period you would be eligible to continue to work till Oct1st or in your particular case the start date mentioned by your employer(Cap-Exempt employer can file for immediate start date and doesn't need to wait for Oct 1)

This year USCIS has notified that the processing time for a receipt could be upto 60 days.Hence the advice to apply for H1b atleast 60 days before OPT expiy because you would need the receipt to get a CAP-GAP extension.