Pepsinogen is made by the chief cells (as they're called) of the mucosa of the stomach. It is an inactive pro-enzyme.
In response to food it is secreted into the stomach's lumen, where it meets hydrochloric acid (HCl), secreted by the stomach's parietal cells. The low pH that the HCl creates allows pepsinogen to unfold and convert itself to pepsin - the active form of the molecule.
Why this elaborate process? Pepsin is a potent protease, meaning that it is capable of breaking down proteins. Pepsinogen, on the other hand, is harmless. So if pepsin were created by the chief cells, it would simply break down the cell's own proteins. Incidentally, the trick of assembling and storing the body's digestive enzymes in an initial inactive form is used by other cells too, notably the pancreas.
Pepsin conducts its work in the stomach. It is only capable of breaking certain types of bonds between a protein's amino acids, thus generating a mixture of amino acids and polypeptides. Ultimately the small intestine absorbs only single amino acids, and so the remnant polypeptides must be further digested later on - using different proteases secreted by the pancreas.