how long to own a stock for dividend
You only need to technically own the stock at 4pm on the ex-dividend date, and not necessarily on the payout date. So technically, even for few minutes/hours of holding is eligible. (3:59 closing day - 9:31 on the ex-dividend day).