During the iOS5 upgrade, the iOS5 firmware will be installed, and the iPhone/iPad will reboot. At that point, the device will be minimally usable -- HOWEVER, no apps, music, videos, etc. will have been restored. Please resist the temptation to disconnect and play with it. If you do so, you will end up with an empty device. If you leave it connected, iTunes will automatically detect it and then start restoring apps, music, videos, and everything else (after a moment, a pop-up dialog box should appear to tell you what's happening). This can take a long time, however (for my 32GB 3GS, it took over two hours).
(The above is true for windows iTunes. I imagine it's also true for OS X iTunes, but I really don't know.)
(The above is true for windows iTunes. I imagine it's also true for OS X iTunes, but I really don't know.)