The P2 and Photon 2 have a RTL8721D MCU with 2048K of flash for your user firmware.
Gen 3 devices (Argon, Boron, B Series SoM, Tracker SoM and E404X) have an nRF52840 MCU with 256K of flash for your user firmware. Prior to Device OS 3.1, it was 128K.
Gen 2 devices (Photon, P1, Electron, and E Series) all have an STM32F205 processor with 128K of flash for your user firmware.
Some tips for understanding the memory used by your firmware can be found here.
Some of the available resources are used by the system, so there's about 80K of free RAM available for the user firmware to use.