Assuming that you are trying to do it from the actual webpage itself, you would use
self.close();
to do this in JavaScript on the page. If you are trying to close a window you opened up, you need to capture the window reference when you create it, and then you can close that window like this:
popup_window = window.open("");
....
popup_window.close();