How many pieces? — a question word used to ask the number of discrete/countable items (often used as 何個〜?).
このりんごを何個買いますか?
How many of these apples will you buy?
箱には何個入っていますか?
How many are in the box?
何個必要か教えてください。
Please tell me how many you need.