Lets say I buy a share of Apple stock. When you talk about stock, you say you are buying a small amount of the company. How small would 1 share of apple stock be at the moment you are answering the question?
What percent of a company are you buying when you purchase stock?
The percent of a company represented by a single share can be calculated by
percent = 1/number_of_shares*100%
Apple comprises 5,250,000,000 shares, so one share makes up about 1.9e-8% of a company, or 0.000000019% of Apple.
As you can see at https://www.google.com/finance?q=NASDAQ%3AAAPL the number of apple shares at this very moment is 5.25B, so if you have 1 share you own 1 / 5.25B of the company.
Your question has already been answered, you divide the amount of shares you own * 100% by the total amount of shares. However, I feel it is somewhat misleading to talk about owning a percentage of the company by owning shares. Strictly speaking, shares do not entitle you to a part of the company but instead give you a proportional amount of votes at shareholder meetings (assuming no funky share classes).
What this means is that someone who owns 30% of a company's shares can't just grab 30% of the company's assets (factories, offices and whatever) and say that they are entitled to own this. What they actually own is 30% of the voting rights in this company, this means that they control 30% of all available votes when the company calls a vote on corporate actions, choosing a new director etc. which is how shareholders exert their influence on a company.