You need to buy and hold a stock through the end of the regular session on the ex-dividend date. You can sell it anytime afterwards and still get the dividend, usually a month later. Personally, I wouldn't recommend it. You have to consider the broker fees, the fact that stock prices usually decline when they go ex-dividend, plus the fact that dividends are taxed at a higher rate than capital gains. That is why many companies buy back their stock instead of paying dividends. Buy-backs increase the stock price, giving stock owners a better benefit.