Stocks and Shares is the same as buying any asset that may go up or down in value. Another example would be a painting.
When you sell your Stocks and Shares, if they have gone up in value then you have made a capital gain. Just the same as if you sold your painting and it had gone up in value.
For tax purposes this money is not treated as income. It is called a ‘capital gain’.
You are allowed to make a total ‘capital gain’ from all the assets that you sell in a year of £12,300. After that you will have to pay tax. Normally at 20%.
It is Slightly more complicated than that. You should read the government website where it is all explained.