Cap-exempt (e.g. non-profit, at school) H1b have no cap and can be applied for at any time, and the start date can be any time.
All other H1b have a cap per fiscal year. The H1b slots for FY2015 (which started in October 2014) have been used up long ago. The H1b for FY2016 (which starts in October 2015) can have an earliest start date of October 1, 2015. H1b can be applied for at most 6 months before the start date. So for a start date of October 1, the earliest you can apply is April 1. If next year is like this year, the spots will be more than used up in the first few days of April, which means there will be a lottery, and which means that even if you apply on April 1 it does not guarantee your application will be accepted.
Before the H1b start date, you are not on H1b and you can only work on OPT. If you are on OPT at the time you apply for cap-subject H1b, then your OPT will be automatically extended until October 1.