Desktops install and uninstall just like any other program. apt-get install kde should give you the complete kde installation. Note though that this is a meta-package that installs pretty much everything, so you may want to manually install the various sub-packages you want instead.
Once you've confirmed that kde is up and running properly, simply uninstall gnome in the same manner.
It might be easier to handle if you use synaptic, aptitude or another user-friendly front-end to apt.