I have recently had some portrait pictures taken and the photographer was able to view the photo straight after he had taken them on his laptop, instead of the camera's LCD.
What cable I need to do this, and what software?
This depends on your camera but the term you are looking for is tethered shooting but not all cameras support this and there are different software for those that do.
The cable is generally a Micro-USB to USB cable but that again depends on the camera. Some older models use proprietary cables with USB on one end and a special connector for the camera.
Adobe Photoshop Lightroom supports a number of cameras in tethered mode but you should look up your model for compatibility. Here is the official list. Note that only Canon, Nikon and Leica are there. Pentax have their own plugin to Lightroom and their own software as well. Sony has demonstrating tethering with Capture One last week at Photo Plus Expo.
Finally some cameras do not require a cable and can do it over WiFi, either as is or via an adapter that is plugged into the camera.
The Nikon D3300 will nor work with Ligthroom, also the official Nikon app will not support it, because Nikon not released any official SDK for his low end cameras.