You close the window and it will work as you desire. Automatically suspending the VM is the default setting, but you have a choice:
* Go to the VMware Fusion menu and choose Preferences...
* Click the General icon.
* Choose "Suspend the virtual machine" (the default) or "Power off the virtual machine" (which will cause the VM to shutdown).
You can also decide whether you want VMware Fusion to display a confirmation dialog box before it closes a VM window.
The confirmation feature is useful if you have a tendency to close windows with Command-W. Sometimes the VM itself has mouse focus instead of a small window running in your VM. You accidentally suspend the entire VM instead of closing a window inside the VM. It happens to me when I run multiple VMs in full screen mode, flipping between screens with the trackpad, and then I type Command-W without clicking inside the VM first. The VM suspends. The "Confirm before closing" setting gives a warning first.
I leave the Confirmation setting disabled anyway, to speed up when I really want to close those VMs. :-)