The space on the Stack is reserved for local variables when they are declared. These are static size (size of allocation is known even before the program run) allocations and are created and freed whenever these variables life starts and ends during a function call/return.
The Data section is made up of the global and static variables, allocated and initialized prior to executing the main. These are static size allocations and they are not freed until the program run finishes. Some of the Data section contents are R/W but some are Read Only (RO) like those used for string literals.
The Heap is used for the dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc. These are dynamically allocated and the size of allocation depends on the runtime values.
The Text section is made up of the compiled program code, read in from non-volatile storage when the program is launched. They are typically Read Only (RO).