IRF and 2N (along with BC, TIP, 2SA, and numerous others) are just the prefix part of the manufacturers part number.
On its own it gives you very little information (some tell you more than others. 2SA tells you more than 2N, but not much).
The next part of the part number tells you enough to look for a data sheet. For example 2N2222 and 2N3055 are the part numbers of some traditionally commonly used transistors.
Following this there may be more letters and numbers which can define all sorts of stuff. TIP31C, for example.
For some devices the full manufacturer's part number goes on for up to a dozen or more additional characters, defining subsets of parameter ranges, the package the transistor is in, and even how the individual devices are packaged for delivery and use (loose, on tape, in tubes, on trays, etc).