In order to root the Galaxy Tab 3 8.0 SM-T310, you need to first install a custom recovery.
You have two options, ClockworkMod Recovery (CWM) or TouchWin Recovery Project (TWRP).
I have personally used both, and they both work perfectly, from what I can tell.
There really is not much of a difference between the two, besides user preference; so choose whichever you’d like.

First, you will need to install Samsung Kies from here: http://www.samsung.com/us/kies/ in order to get all of the drivers and such installed.

Next, you will need a copy of Samsung Odin, which you can get from here: http://uploaded.net/file/o2xcp01n
Then you’ll need to download a copy of CWM or TWRP from here: (link removed – d-h.st is gone!) or (link removed – d-h.st is gone!)
Now, you’ll also need to download this flashable zip to install the SU binaries: http://www.mediafire.com/download/wjye1yssb5ksbfa/ROOT_SGT3_8.0.zip

Installing TWRP Recovery on the Galaxy Tab 3 8.0
1. Extract Odin307.zip to a folder on your desktop.

2. Copy TWRP_T31x_r3.tar to the extracted Odin307 folder.

3. Double-click on Odin3 v3.07.exe from the extracted folder to start the Odin tool.

4. Power down your device and put it into download mode. To do this, press and hold the Home + Volume Down + Power buttons simultaneously for 3 to 5 seconds until you see the warning screen.

5. Connect your device to your Windows PC using a compatible microUSB cable. If your PC installs drivers at this point, let it do so. Once that is done, the ID:COM field on Odin should light up yellow, signifying that Odin has recognized your device without a problem. If not, make sure you install the proper drivers (by installing Samsung Kies) and try again.

6. Click on the PDA button on Odin and navigate to the location of TWRP_T31x_r3.tar to load it on to Odin.

7. Wait for the PASS message on Odin and reboot your device.

You should now have TWRP Recovery installed!

Rooting the Galaxy Tab 3 8.0
1. Boot into recovery by powering down the device, pressing and holding the Power + Volume Up buttons until you see the Galaxy Tab 3 splash screen and letting go of the Power button once you see it. Continue pressing the Volume Up button until you get to TWRP Recovery.

2. Hold your device in portrait mode, and tap on Reboot on the bottom right of the screen and then select System on the next menu.

3. You will be asked to install root. Accept it and the device will reboot.

4. Follow the on-screen instructions that will now appear after your device has powered on.

Alternate method for Rooting
If the section IV steps failed to obtain root, here is an alternate method to get you going.

1. Copy the ROOT_SGT3_8.0.zip you downloaded above to your internal/external SD card.

2. Boot into TWRP Recovery as detailed in Section IV > Step 1.

3. Tap on Install once in TWRP Recovery.

4. Navigate to the location of ROOT_SGT3_8.0.zip and select it.

5. Swipe to confirm the flash.

6. Go back to the main menu, tap on Reboot and then tap on System.

Credits and original posts can all be found here:
Samsung Odin, drivers, etc.. courtesy of @daerragh here: http://forum.xda-developers.com/showthread.php?t=2189539

CWM and TWRP courtesy of @emwno located here: http://forum.xda-developers.com/showthread.php?t=2385539 and http://forum.xda-developers.com/showthread.php?t=2386098

SM-T310 flashable SU zip courtesy of @abdoel_046 http://forum.xda-developers.com/member.php?u=4655714

Root guide courtesy of @eeamshh here: http://forum.xda-developers.com/showthread.php?t=2525630