A company goes ex-dividend when it has declared that people will receive dividends, and it stays ex-dividend until the dividend payments have been made to shareholders. As of the ex-dividend date, the seller, and not the buyer, owns the dividend amount. The stock is traded either on the day the company declared ex-dividend or soon after that date.
A company experiences a drop in stock price when it goes ex-dividend, notes Investopedia. Companies usually go ex-dividend four days before the date of record, which is when shareholders own their dividends according to the company's financial statements, notes The Street. However, the United States Securities and Exchange Commission notes that the dividends aren't actually paid to shareholders until a later date.