"15W40" refers to the viscosity grade of a multi-weight oil, where 15W refers to a cold grade of 15 and 40 refers to its viscosity grade at running temperatures. The higher the viscosity grade, the thicker the oil is, which affects its lubrication ability, heat capacity and flow.
Normally, an oil's viscosity thins at a fast rate when cold and then stabilizes as the running temperature is reached. This is beneficial for cold-starting engines because it allows the oil to quickly reach critical engine components and protect them from damage. However, the oil normally becomes too thin to carry the required load and heat from the engine. Multi-weight oils solve this problem by using polymers known as VI improvers; this slows down the rate at which the oil thins and makes its viscosity at running temperatures comparable to a thicker oil.