"ID number" redirects here, for the player's ID number, or 'secret ID' please see Bulbapedia's respective article.
In the Pokémon games, an identifier (also index number or ID number) is a number used within the game's code to identify pieces of data. Pokémon, items, locations, moves, and abilities all have unique identifiers; in each game, no two Pokémon have the same identifier. Pieces of data in different categories, however, may share identifiers -- a Pokemon and an item may use the same identifier, for instance. Identifiers may be likened to character codes in computer text.
In the first generation core games (Red/Green/Blue/Yellow versions), the Pokémon's identifiers did not match the Pokédex numbers assigned to them (e.g. Pokédex number 1 is assigned to Bulbasaur, while identifier 1 is assigned to Rhydon).
The index number ordering is believed to reflect the order that Pokémon were programmed into the game (except for Mew; hex:15, who was actually a 'last minute' addition to the game), and this is supported by an interview (original Japanese version) that states Rhydon was the first Pokémon ever made. However, Ken Sugimori lists Clefairy and Lapras after Rhydon, while index numbers 2 and 3 are used for Kangaskhan and Nidoran♂.
Note that 39 Missingno. are found in the list between valid Pokémon, and the number of official Pokémon +39 equals 190; a round figure. According to a post from Zog on Smogon, Shigeki Morimoto confirmed that there were originally 190 Pokémon, and that the rest were saved for later.
The identifier, not the Pokédex number, must be used for cheat codes and in-game glitches like the Old Man Trick or Ditto Trick.
Later generations have Pokémon index numbers that match their Pokédex order, except for Generation III, which includes "?" glitch Pokémon in between the index numbers of Celebi and Treecko, and certain Pokémon in an earlier or later order, such as the Ralts line existing later on in the internal ordering, grouped before the Bagon family.
Item identifiers are relatively constant throughout generations (i.e. item ID 1 is always the Master Ball).
An identifier is also referred to as a "hex", due to the fact that identifiers are often represented in hexadecimal notation.