Most companies pay you if you work the entire quarter even if you leave after. Some will try to screw you. You won't get that money till September anyway.
I believe you must be employed the day the checks are cut. The only time that might not be true is the 4th qtr bonus. the 4th qtr only I think you only have to be employed on the last day of the year to get the check that is it in feb