http://support.apple.com/specs/
11/1997-7/2002 The G3 and G4 Macs released during this period (except the original G3/250 Powerbook) can use the 9.2.1 retail installer disc to install Mac OS 9. If they shipped with a version of 9, they can only use a newer retail version of 9 to install 9 for use with the Classic environment. A minimum of 9.1 needs to be installed to use Classic. The article below lists which versions of 9 each Mac shipped with:
Mac OS: Versions, builds included with PowerPC Macs (since 1998) - Apple Support
If you need to upgrade to 9.1 or higher, follow the directions in these articles:
Mac OS 9: Available Updates - Apple Support
How to find Mac OS 9 downloads?
Also check if the firmware needs to be updated before installing 10.2 or later:
Mac OS X: Available firmware updates - Apple Support
8/2002-12/2002 The Macs which shipped new during this period shipped with a restore 9 installer disc and could not use the retail installer disc for Mac OS 9. Call AppleCare if you are missing those discs:
http://www.apple.com/contact/phone_contacts.html
To install Classic from the restore discs, follow the directions in this article:
http://support.apple.com/kb/HT1561
867 Mhz Macs and faster Macs that shipped during this period 11/1997-12/2002 can also boot into 9 when Leopard (10.5) is installed, but can't use Classic unless Tiger (10.4) or earlier is installed on a separate bootable hard disc, or partition of the boot hard drive. Pre-Firewire 800 Powermac G4s which shipped during the next time period also have this ability if they were 867 Mhz or faster.
1/2003-12/2005 The machines which shipped new during this period (except the PowerMac G4 pre-Firewire 800 which could boot into 9) could only use Classic, and thus once upgraded to Leopard can't use Classic anymore. If you kept a separate partition or booted off an external hard drive that had Tiger they could continue to use Classic. Article http://support.apple.com/kb/HT1561 still applies for restoring Classic to Tiger and older operating systems on these Macs.
1/2006 - present Intel Macs which shipped during this time period can't use Classic at all.