As @HartCO says in his comment, in the US, if you sell an investment in less than a year it's considered "short term" and subject to your regular tax rate. Longer than a year is "long term" and is taxed at a lower rate.
There's no "amount that you can withdraw". Whatever amount you withdraw less than a year after the original investment is taxed at the higher rate.
Oh, and you can't say that you are withdrawing the principle and leaving the profit. That's not how it works. Whatever amount you withdraw is proportionately allocated between principle and profit.
Suppose you invest $100 and at the time you want to withdraw it it has grown to $110. If you withdraw the entire amount, you pay tax on the $10 profit. If you withdraw half of the amount, $55, that's understood to mean $50 principle and $5 profit and you pay tax on the $5 profit. In practice, there's no formula to apply. You're going to sell a certain number of shares in an investment, and the profit is the difference between what you sold those shares for and what you paid for them.
(There are more complex cases if you aren't buying "shares" of something. Like if you bought a piece of land, and then some time later sold half of that land, computing the value of the portion of the land that you sold in relation to the value of the whole is not necessarily a trivial calculation. But I don't think that's your question here so I won't get into that further.)