This article pertains to black, green and white pepper berries (Piper nigrum), also known as peppercorns when dried. Other plants/ingredients commonly known as pepper include:
- the chili pepper (including the bell pepper), and
- several Asian spices including 'pink' peppercorns and Szechuan pepper.
The black, white and green peppers are actually the same berries harvested and processed at different stages of ripeness. They are very similar in flavour and texture, with the main difference being the colour. They are commonly used in Western cooking as seasoning.
The pepper berry is one of the most common spices in European cuisine, having been known and prized since antiquity due to its strong flavour. It is said that Alaric the Visigoth demanded from Rome a ransom of gold, silver, and pepper.
Black Pepper 
Black pepper is a seasoning produced from the fermented, dried, unripe red berries of the plant Piper nigrum. (The same fruit, when unripe green, can be dried, or preserved in brine or vinegar, to make green peppercorns; or when ripe, dried and dehusked to make white peppercorns.)
Ground black pepper may be found on nearly every dinner table in some parts of the world, accompanied by its constant companion salt.
Cooking with Pepper 
Black pepper is generally used when you want it to show up in the dish (especially in a whole or 'cracked' form) and white pepper when you do not want it visible in the finished product.
Pepper added at the beginning of a recipe makes the whole recipe taste peppery. When added at the end of a recipe parts of the recipe taste peppery and other parts don't because the pepper won't be evenly distributed among the food.
Grinding pepper releases flavorful volatile oils that evaporate after time, so the full flavor of pepper is obtained when it freshly ground onto food at the end of cooking or after serving.