You can carry up to 23 different items, not counting those in your equipment. Often, many identical objects can be "stacked" into a "pile" which will count as a single item. This is always true of things like potions, scrolls, and food, but you may have to set options to allow wands, staves, and other such objects to stack. Each object has a weight, and if you carry more objects than your strength permits, you will begin to slow down.
Use Inventory list (i) to view your current inventory.