Hi, Daniel -
In general, "memory" refers to RAM and related functions like Virtual Memory. None of that is permanent - whenever the machine is shut down or restarted, everything in RAM is wiped.
When a program is started up (the OS is a program for this purpose), it is loaded into RAM. In the process of doing that, the program grabs a certain amount of RAM for its exclusive use - some of it to hold the loaded program, some of it to use in doing its calculations, some of it to hold data (like an image). When the program is quit, the RAM it had grabbed is released and made available for something else to use.
There are some special instances of memory, such as PRAM and NVRAM, which can (most of the time) be ignored.
PRAM contains things the machine would like to know during startup, before certain preference files can be read - things like what volume to use for booting; what video parameters to use; etc. PRAM is volatile, meaning its info will be lost if the machine is unplugged and the battery removed.
NVRAM also contains things that the machine needs to know, such as what hardware is available. NVRAM is non-volatile (that's what the NV in its name stands for), meaning that even if you remove power and battery, the settings in NVRAM will remain. In order to return NVRAM to default (original) settings, the user must initiate that action.
***
Memory is not the hard drive. Space on the hard drive is generally referred to as, well, hard drive space, or storage, or something similar.
The hard drive contains all the files on the machine: all the programs, all their supporting files, all the documents you have created and saved - all are data on the hard drive. When new software is installed, it is copied to the hard drive.
Items on a hard drive are considered non-volatile - that is, removing power and battery from the machine will not cause the loss of any of the items on the hard drive (at least for a reasonably long time - many years, perhaps, but not forever since hardware does degrade over time).
***
Everything you see on the screen is in RAM. Changes to a document or file do not become 'permanent' until the document is saved - the act of saving a file transfers the changes to the copy of the file on the hard drive. If you make changes to a document, then lose power or have the program or OS lock up or crash, none of the changes will be saved. If you close a document after making changes to it and decline the offer to save the changes, the changes will be lost.
***
When a program crashes, if you're lucky an alert box will appear giving a message of some kind, often citing an error code. Knowing the exact wording of the message and the error code can help a lot in trouble shooting.
Many programs can crash because insufficient memory (RAM) has been allocated for them to use - once a program uses up all that was set aside for it, it will crash. Restarting the machine should make it possible to use the prgram again, until it runs out of RAM again. If that is the cause of the problem, increasing the RAM allocation for it can help a lot. This Apple KBase article addresses that -
Article #TA21666 - Assigning More Memory to an Application
The number to change is the Preferred amount. Note - in order to change a program's memory allocation, it must not be running; enter plain numbers, no commas; the Get Info must be done on the icon of the program itself, not on that of an alias to it or on that of its folder.
Browsers are particularly susceptible to running out of RAM; doubling or tripling the original Preferred amount is a good starting point.
***
When a program crashes, and won't run again after the machine has been restarte, and/or other programs won't run, it indicates something has happened to either the OS or to the hard drive.
If the OS loads at booting and you are able to use Finder's menus, the OS is probably OK.
Things that can mung a drive - damaged directories; damaged desktop files; drive is too full (good practice indicates leaving about 15% or more free space on the drive). Determining which might be the cause usually calls for having a bootable OS Install CD of adequate version available.