Everytime I open up Firefox and Photoshop CS on my macbook and close them up via the X button at the top left corner of their windows, their windows close but my macbook still lags and shows my memory unchanged. I open Activity Monitor and the applications are still open using up to 1GB of RAM each. I have to click on each app and Quit (not Force Quit) them in order for the RAM to open up and be freed up. Why aren't these apps closing out automatically each time instead of being closed via Activity Monitor? These two apps take up a lot of RAM on my macbook.
Closing the last window of an application doesn't necessarily close the application.
For example, opening two TextEdit windows and then closing them both (kbd>Cmd-W or click the red close button top-left of window) will not close TextEdit. This allows one to click File>New (or Cmd-N) to open and work on a new TextEdit document.
You may be familiar with how Microsoft Windows manages applications. It actually opens a new instance of Firefox, for example, for each window that you open. On the Mac, that's not necessarily the case.
People who learn to use Microsoft Windows before learning the Mac are often confused at first because the Mac uses a different conceptual model. This is how Macs have always been, more or less.
Mac users get used to typing Cmd-Q if they want to completely quit an application. Often, this is not necessary. But if your machine doesn't have much RAM, you may notice memory hogs like browsers slowing things down.