If you claim more than $5,000 of franking credits in one financial year then the 45 day rule applies. You must hold the shares "at risk" (that's the ATO's term) for a minimum of 45 days to claim a franking credit. Note that the 45 days does not have to come after the ex-dividend date or the dividend payment date. You can own the shares for 45 days prior to the ex-dividend date and sell them on that date and still claim the franking credit.