How do I install GDM and any other necessary packages for it to run on the Raspbian image?
Assuming you just want to install GDM, and not an actual window manager, just run.
This would be strange though as GDM is a display manager. A display manager only provides the equivalent of a login prompt. In order to actually use your desktop you would need to install a window manager, such as GNOME or Xfce.
So, just in case you would like to also install a window manager then you need to do the following.
The Pi doesn't have very powerful hardware. GDM will have heaps of Gnome dependencies. It might be better to look for a lighter weight login manager. SLIM might be a good choice (I think Raspbian is using it). Otherwise LightDM is what Ubuntu uses.