When shutting down, how to re-open apps on their respective desktops?
If apps don't obey OS X's default windowing (which is to put apps back where they were before you logged out), then you can lock them to specific desktops which forces them to obey:

Right-click on the app in the Dock, then choose Options → This Desktop.