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?
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.