Dividends are payments made by a company to its shareholders. When a company earns a profit, that money can be put to two uses: it can either be re-invested in the business (called retained earnings), or it can be paid to the shareholders of the company as a dividend. Paying dividends is not an expense; rather, it is the division of an asset among shareholders. Many companies retain a portion of their earnings and pay the remainder as a dividend. Publicly-traded companies usually pay dividends on a fixed schedule, but may declare a dividend at any time, sometimes called a special dividend to distinguish it from a regular one.
The profits of a company can either be reinvested in the business or paid to its shareholders as a dividend. The frequency of these varies by country. In the United States, dividends of publicly-traded companies are usually declared quarterly by the board of directors. In some other countries dividends are paid biannually, as an interim dividend shortly after the company announces its interim results and a final dividend typically following its annual general meeting. In other countries, the board of directors will propose the payment of a dividend to shareholders at the annual meeting who will then vote on the proposal.
In the United States, a decision regarding the amount and frequency of dividends is solely at the discretion of the board of directors). Shareholders are explicitly forbidden from introducing shareholder resolutions involving specific amounts of dividends (SEC Form 8-A )
Where a company makes a loss during a year, it may opt to continue paying dividends from the retained earnings from previous years or to suspend the dividend. Where a company receives a non-recurring gain, e.g. from the sale of some assets, and has no plans to reinvest the proceeds the money is often returned to shareholders in the form of a special dividend. This type of dividend is often larger than usual and occurs outside of the normal dividend distribution schedule.
Dividends must be "declared" (approved) by a company’s Board of Directors each time they are paid. There are four important dates to remember regarding dividends. These are discussed in detail with examples at the Securities and Exchange Commission site 
The declaration date is the day the Board of Directors announces its intention to pay a dividend. On this day, a liability is created and the company records that liability on its books; it now owes the money to the stockholders. On the declaration date, the Board will also announce a date of record and a payment date.
The ex-dividend date is the day after which all shares bought and sold no longer come attached with the right to be paid the most recently declared dividend. This is an important date for any company that has many stockholders, including those that trade on exchanges, as it makes reconciliation of who is to be paid the dividend easier. Prior to this date, the stock is said to become dividend ('with dividend'): existing holders of the stock and anyone who buys it will receive the dividend, whereas any holders selling the stock lose their right to the dividend. On and after this date the stock becomes ex dividend: existing holders of the stock will receive the dividend even if they now sell the stock, whereas anyone who now buys the stock now will not receive the dividend.
It is relatively common for a stock's price to decrease on the ex-dividend date by an amount roughly equal to the dividend paid. This reflects the decrease in the company's assets resulting from the declaration of the dividend. The company does not take any explicit action to adjust its stock price; in an efficient market, buyers and sellers will automatically price this in.
Shareholders who properly registered their ownership on or before the date of record will receive the dividend. Shareholders who are not registered as of this date will not receive the dividend. Registration in most countries is essentially automatic for shares purchased before the ex-dividend date.
The payment date is the day when the dividend cheques will actually be mailed to the shareholders of a company or credited to brokerage accounts.