M.2 describes the slot and the physical form factor of the part.
- The slot has "keys" in it. For storage the keys are in positions known as B and M. Most M.2 slots these days are M-keyed.
- The physical form factor for storage is commonly in the format of 22mm by either 30, 60, or 80mm. Most M.2 drives are 22mmx80mm (commonly referred to as 2280).
NVMe is the protocol that the SSD uses to talk to the rest of the computer. The alternative is SATA. NVMe also almost exclusively uses PCIe as the physical connection. So NVMe is faster than SATA. The speed the NVMe drive operates at though depends on what the SSD supports (typically either PCIe 3.0 or 4.0, up to 4 lanes) and how many PCIe lanes are connected to the M.2 slot (usually 2 or 4 lanes are provided).
NVMe and SATA can both be on an M.2 SSD. I mentioned the slot having keys, NVMe SSDs can only be used in M-keyed slots, whereas SATA SSDs that are in an M.2 form factor can usually fit in both B-keyed and M-keyed slots.
The only other M.2 slot configuration I'm aware of in widespread use is the A/E keyed slot, which is normally used for Wi-Fi adapters.