The tax treatment of the account depends on the type of account.
If it is a 529 investment account, distributions are generally tax-free if used for qualified education expenses, which would include college tuition. This article has a good overview of these types of accounts: 529 Plans and Taxes: Deductions, Tax-Free Withdrawals & More
If it is a typical investment account (through a brokerage), gains will be taxed as capital gains. If the investment account ownership is yours/your spouse's, any gains there will be taxable to you as standard capital gains. However, if within income limits, you may be eligible for education credits for paying qualified education expenses for a dependent. This article has more information on education credits: How do Education Tax Credits Work?
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"