Update your package system.
sudo apt-get update
Install the Ubuntu desktop package. This package seems to be a super package containing many package dependencies. It literally downloaded about 1.7 GB of software. Gdm is part of this install, so you don't have to do an individual install of that after the fact.
sudo apt-get install ubuntu-desktop
Gdm automatically starts the X system during bootup. To configure it to start, do the following:
sudo /etc/init.d/gdm start
You may need to reconfigure your video card, keyboard, etc. To do so, do the following:
sudo dpkg-reconfigure xserver-xorg