Use number for things you can count separately — a number of people, a number of errors. Use amount for things measured as a mass — an amount of water, an amount of work. The test is whether you could put a figure on the items: if you can count them, it is a number.
The core difference
The same count-versus-mass distinction that separates fewer from less.
- number — countable: a number of complaints, a large number of visitors.
- amount — mass or uncountable: a small amount of milk, the amount of effort.
Where it gets interesting
Money and time behave as masses even though they are countable: an amount of money, not a number of money. And a countable thing treated in bulk can take amount — "the amount of paperwork" is fine because you are measuring the pile, not counting sheets.
The related pair
Fewer goes with countables and less with masses, following exactly the same logic — fewer errors, less water. If you know which of those to use, you know which of these.