The name itself tells the actual purpose of the tax. Capital gains tax is the tax that is levied by the government on the capital gains earned. When an asset is transferred between two owners and if there are any gains that the seller is gaining from the transaction, then the tax on such profit is termed as the capital gains tax.
There are in general two types of capital gains tax. They are Long term capital gains tax and short term capital gains tax. The long term capital gains tax is when the assets are owned for more than 1 year. But if the asset is sold within 1 year of purchase, then it is termed as short term gain and hence short term capital gains tax to be paid. Generally, the STCG tax is more than the LTCG tax.