Your goal as an investor may be to buy quality stocks and eventually see them gain value. But what if you're currently sitting on a stock that's gained a lot? You may be tempted to take your money and run. But before you do, ask yourself these important questions.

1. Have I held my stock for at least a year and a day?

When you sell a stock at a higher price than what you paid for it, you trigger taxes on your capital gains. But the amount of those taxes will vary depending on how long you held your investment.

Stocks held for at least a year and a day get bumped into the long-term capital gains category, which means a smaller tax burden for you to bear. But stocks held for a year or less are subject to short-term capital gains, the rate of which is higher and mimics ordinary income tax rates. That could result in more of a financial hit.

Smiling person holding mug at laptop.

Image source: Getty Images.

2. Do I have losses to offset gain?

It may be the case that you have an underperforming stock in your portfolio, just sitting there taking up space. Selling that stock at a loss could be a smart move for a few reasons.

First, it could make sense to unload that stock before its value declines further, if you have reason to believe that could happen. Second, freeing up that cash could make it possible for you to replace a losing stock with a different one with more growth potential, or one that lends to more diversity in your portfolio.

From a tax perspective, selling stocks at a loss can work to your benefit, too. That's because capital losses in your portfolio can be used to offset capital gains.

In fact, if you're thinking of selling a stock at a profit, see if you're sitting on any stocks worth dumping first. It could end up working out so that you don't have to pay capital gains taxes at all.

3. Do I think this stock will continue to climb?

You may own a stock that's gained a fair amount of value since you first bought it. But is that stock done growing?

It may be the case that the company behind it has a great management team, excellent cash flow, and a solid pipeline of products under development. If that's the case, hanging onto that stock for a longer period of time could mean seeing its value rise even more.

In fact, if you don't have reason to believe that the stock in question has peaked, and you don't have a pressing need for money, it could pay to leave your portfolio alone. Buying quality stocks and holding them for many years is a strategy that commonly works well for investors, and there's no reason to think you won't have the same experience.

You may be inclined to sell a stock that's gained value since you purchased it. But don't rush to unload it. Instead, run through these questions to make sure you're selling that stock at the right time.