The X button closes a window. It doesn't do anything to the program the window was in. Some programs that only ever have one window will quit when you close their window, but that isn't normal. To quit a program, you choose "Quit" in the application menu.
And in most applications, option-clicking on the grow widget will make a window expand to fill the screen.