The amount of your company that you'll have to sell depends on the value of the company when you take the investment.
For example, if your company is worth $1 million before the investment (the pre-money valuation), and you take an investment of $500,000, the post-money valuation will be $1.5 million (because there is now another $500,000 in the bank). Because the investor bought $500,000 worth of a $1.5m company, they now own 1/3rd of the company.
So, to figure out how much you're going to have to sell, you need to know how much the company is worth before the investment and how much investment you are taking.
Both of these figures are a matter of negotiation between you and any potential investors and will be described in the term sheet which the investor gives you when they agree to invest in your company.
All else being equal, you will want to negotiate as high a pre-money valuation as possible, because that way you give up the smallest number of shares for a given number of investment dollars.
As usual in negotiation, the stronger your negotiating position, the higher a valuation you will get. The strength of your negotiating position depends on how strongly the investor wants to do the deal, and how much competition there is to do it. The best things you can do to get a high valuation are to have a very attractive company that investors are dying to invest in, and get multiple investors lining up so there is competition to invest in your company and you can choose the best investor.