XWindows is the underlying graphical (window) system or GUI of most Unixes. (Mac OS X uses Quartz and is an exception). The code base is currently maintained by x.org (after the previous xfree86).
Desktop enviroment like KDE and GNOME can run on top of this graphical system.
By defauly, most Unixes run X in one of the terminal (TTY). Most unixes have 8 TTY (tty0 to tty7). TTY0 is usually used for local system maintenance. TTY0 often receives system messages on stdout. X Windows (at least on Debian) runs X windows on TTY7.