Companies announce a dividend per share and a record date; you must hold the shares on that date to receive it. In India, dividends are taxed in the hands of the shareholder at their slab rate.
Finance glossary
What is Dividend?
A share of a company's profit paid to its shareholders, usually in cash.