Extraplanar is a subtype applied to any creature when it is on a plane other than its native plane. A creature that travels the planes can gain or lose this subtype as it goes from plane to plane. The Monster Manual assumes that encounters with creatures take place on the Material Plane, and every creature whose native plane is not the Material Plane has the extraplanar subtype (but would not have when on its home plane). Every extraplanar creature in the Monster Manual has a home plane mentioned in its description. These home planes are taken from the Great Wheel cosmology of the D&D game (see Chapter 5 of the Dungeon Master's Guide). If your campaign uses a different cosmology, you will need to assign different home planes to extraplanar creatures.
Creatures not labeled as extraplanar are natives of the Material Plane, and they gain the extraplanar subtype if they leave the Material Plane. No creature has the extraplanar subtype when it is on a transitive plane; the transitive planes in the D&D cosmology are the Astral Plane, the Ethereal Plane, and the Plane of Shadow.