Any realized gains on your investments will create a tax liability in taxable accounts (that is, accounts that are not an IRA, 401(k) or other tax-advantaged accounts). You’ll have to pay taxes on any dividends as well as any realized capital gains – stocks you sold for a gain.
The tax rate you pay depends on your income and how long you owned the security. If you owned the security for less than a year, you’ll have a tax rate that is the same as your income rate. If you owned a stock for more than a year, you’ll pay the long-term capital gains rate, which may be more or less than your short-term rate (and sometimes even at a 0 percent rate).