Mass is, in a sense, interchangeable with energy, but the ways in which mass and energy can be interchanged are limited by the particular interactions allowed in the Standard Model.
First and foremost, all conservation laws must be obeyed. Since the photon carries no charges, this typically means that photons can only turn into matter-antimatter pairs, rather than, for example, isolated electrons. In addition, photons are spin-1 particles, and the conservation of angular momentum therefore forbids the creation of certain combinations of particles (for example, the photon cannot split into two spin-zero particles).
There are also other kinematic conservation laws (conservation of energy and momentum, for example) that must be obeyed. This means two things: first, the photon cannot create a set of products whose total mass is larger than the photon's energy. This is because the mass is the energy required to create these particles at rest, with any additional energy being manifested as kinetic energy of the products. As such, the total mass represents the minimum energy that a photon must have to produce a given set of products. Second, the conservation of linear momentum requires that a photon cannot produce matter spontaneously in a vacuum. Some interaction with another photon (in real life, this is typically a photon from the electromagnetic field around an atomic nucleus) is required in order to balance the momentum.
In addition, photons are excitations of the electromagnetic field; as such, they can only interact with particles with electric charge (or, with sufficient energy, composite particles made of charged constituents). In particular, this means that it is not possible* for a photon to turn into a neutrino-antineutrino pair, even though neutrinos have very small masses, because neutrinos are electrically neutral.
By far the most common mass-creation mechanism is the creation of an electron-positron pair (usually simply called pair production). This is by far the most common because electrons and positrons are the lightest charged particles in the Standard Model, and so represents the lowest energy threshold for mass creation. The electron mass is 511 keV, and so the threshold for electron-positron pair production is 1.022 MeV. This is a very high energy for a photon, placing it well into the gamma-ray range, and is not often found in terrestrial conditions. Pair-production processes for heavier particles exist, but the threshold energies are far higher, and producing or finding photons at these energies is difficult outside of particle accelerators or extreme astrophysical situations.
*When the words "not possible" are used in these discussions, they refer to processes evaluated in the low-energy regime of the theory, often called "tree-level" because the reaction diagrams (Feynman diagrams) are drawn as simple, tree-like structures. Allowing for more complicated diagrams opens up more possibilities (for example, photons can actually scatter off of each other in such diagrams), but such diagrams are only important at very high energies, much higher energies than most pair-production thresholds. As such, these more complicated diagrams are neglected here.