Most of my knowledge is not Windows-specific, so bear with me:
The heap and the stack refer to different areas in memory (but we are still talking about main memory in each case). This is not particular to any language. The heap lives in the low memory addresses and grows upwards; the stack lives in the high memory addresses and grows downwards. This is to keep them from overlapping (which would be very bad).
On a 32-bit architecture, the EBP and ESP registers keep track of the current stack frame. EBP is the base pointer - this points to the high address of the current stack frame. ESP is the stack pointer and it points to the low address of the current stack frame.
Remember that the concept of free / allocated heap and stack memory is mostly relevant at the application level. At the machine level, all memory looks the same - it is up to the programmer (or compiler) to keep track of which memory segments are in use.
The stack is managed by a combination of: instructions that call functions, and explicit modifications to EBP and ESP. Anything below ESP is considered freed; so to free memory you can just add to ESP.
The heap is managed by memory allocation methods; documentation can be found here. I am not sure about the particulars of Winows, but in general there will be some memory manager that has the responsibility of making sure no block of memory is allocated to more than one application.