Image source: Getty Images.

We're long-term investors at The Motley Fool, but there are still times when even a long term investor would be better served selling a stock than hanging on.

In this clip from Industry Focus: Tech, Dylan Lewis and David Kretzmann talk about when it's best to sell a company that's past the point of reasonable valuation, why it's so tricky to really know, and why it might be best to play it safe with this metric.

Check out other reasons to sell a stock:

A full transcript follows the video.

A secret billion-dollar stock opportunity
The world's biggest tech company forgot to show you something, but a few Wall Street analysts and the Fool didn't miss a beat: There's a small company that's powering their brand-new gadgets and the coming revolution in technology. And we think its stock price has nearly unlimited room to run for early in-the-know investors! To be one of them, just click here.

This podcast was recorded on Aug. 26, 2016.

Dylan Lewis: No. 3: You believe the company has gone beyond a reasonable valuation. I think this is probably one of the toughest ones to nail down, particularly because, as Fools, a lot of the companies we like are growth-oriented, and they have these very gaudy valuations.

David Kretzmann: Exactly. I think something you have to keep in mind here is, if you like everything about a business except the valuation, you probably don't want that to be the only reason you sell, because valuation is such a tough thing to pin down. Let's say you really love a business and you want to sell because of the valuation. That kind of implies that, at some point, you'd be interested in buying back shares. If you love the company and let's say the stock got hit in half, you'd probably want to buy shares. The problem with that is that you'd have to be right not just once but twice. You have to be right first when you sell the shares, and you have to be right when you buy the shares.

Lewis: And we talked about how difficult timing that is.

Kretzmann: Yeah. So, all of a sudden, you're not just timing one thing. When you buy or sell, you are timing both. And that just raises the probability that you're going to make a bad decision as an investor. I'll preface this section by saying you probably don't want valuation to be the only reason you sell a stock. But maybe you sell your position in stages, maybe you just sell half of it, something like that.

Lewis: Yeah, I think the way to think about this, and it is, like you said, very difficult, is, if there's a massive disconnect between what the business is being valued at and the value and growth that you're able to recognize, then you might have a case for selling shares. And maybe if you're looking for indicators there, are you agreeing with the total addressable market that's being assigned to this business or service or segment or product or whatever? Or is it just unfathomable to you? And if the company has growth plans, whether they would be physical locations, entries to foreign markets, do you believe they'll be successful there? If not, if it's no to either of those, then maybe you have a case for selling.

Kretzmann: Yeah. I think it's important to look at, what does valuation mean? And really, what the valuation means for long-term investors is, it gives you an idea of what the company needs to do to become a good long-term investment for you. Let's look at a recent tech company IPO, Twilio (TWLO -1.49%). This is a company that makes communication software for apps that companies like Airbnb, Uber, integrate into their apps. All sorts of communication stuff.

Lewis: This is a company that's going to be a topic of a tech show down the road.

Kretzmann: So this is a preview of Twilio from a valuation perspective. Right now, Twilio's not generating net income or cash flow. So one of the valuation metrics you can look at is sales. [Price-to-sales] ratio is 21 for the company, and that's a lofty number. To give some context, Facebook trades at a P/S ratio of 16, Twitter at about 5, and LinkedIn -- being bought out by Microsoft, which we'll talk about in a bit -- at about a little over 7. So Twilio is clearly trading at a premium compared to some of these other tech companies.

To justify the valuation today -- let's say you want to invest in Twilio because you think over the next five years, this is a company that can grow and be a market-beating investment from today. Just some back-of-the-envelope math here: If Twilio grows sales at 35% annually each year for the next five years, and trades at a P/S ratio of 8, in five years, the stock would less than double from today.

Lewis: And those are impressive growth rates.

Kretzmann: I would say, from what I understand of the company, I think that's a pretty optimistic scenario. But perhaps they can grow sales at 50%, maybe they'll trade at a higher valuation. It's tough to pin down. But back-of-the-envelope math like that gives you an idea of what the company needs to do to justify the stock today. In the case of Twilio, that seems like you're taking on a lot of risk for not-so-great of a reward. That basically means the company has to pump out lights-out growth quarter after quarter, year after year, and still trade at a premium valuation in five years to less than double from today. I think, in the case of Twilio, I would look to other areas. If I owned this stock, I certainly wouldn't be looking to add at these levels.