I've previously covered a way of doing it for the AT&T version of the Samsung Galaxy S4 that has the MF3 firmware on it, but you needed an SD card reader, unzipping software, a terminal emulator, and more. Definitely not an easy task for a first-time rooter.
However, thanks to the crafty developers at Kingo App, root can be attained with just one click now, and not just for the GS4, but for almost any Android phone on the market.
Read & Heed, Before You Proceed
You'll need to have the following components ready:
Your Samsung Galaxy S4
Micro USB cable
A Windows PC
Also be aware this rooting method does not install a custom recovery. A recovery is a software that lets you flash custom ROMs like CyanogenMod onto your phone, as well as perform system level maintenance, like backing up and restoring nandroid files. You'll have to manually install a recovery yourself if you'd like to do that.
If you have the Verizon Galaxy S4 with ME7 firmware, or AT&T Galaxy S4 with MF3 firmware, unfortunately your bootloader is locked, so you won't be able to install a custom recovery at all. Attempting to install a recovery like ClockworkMod or TWRP will likely turn those GS4 variants into nothing more than shiny, expensive paperweights.
Even if your Galaxy S4's bootloader is locked, you can still attain root with this method.
Step 1: Enable USB Debugging
You'll need to have Developer options enabled, which you can easily do by following Faisal's softModder guide. You can then access Developer options by going to your GS4's Settings -> More, and it'll be the second from the bottom. Tap on it, then make sure USB debugging is checked.
Step 2: Download & Install Kingo Root on Your PC
This one-click rooting method is provided by Kingo. You can grab the PC software from their download page. The download should start within a few seconds of opening the page on your computer. If you have another device to root, Kingo probably supports it too (just make sure to check out their list of compatible devices for reference).
Once you've downloaded the file, open it up and run the installer, then open up the program.
Step 3: Connect Your GS4 to the PC
Connect your Galaxy S4 to your computer with the micro-USB cable. Kingo Root will detect it and start installing the device's drivers (if necessary).
You may be prompted to disconnect the phone for the drivers to finish installing. Go ahead and disconnect the cable, and Kingo will let you know when to reconnect it.
Keep an eye on your phone for an "Allow USB debugging?" alert. Make sure to choose OK.
Step 4: Get Ready to Root!
You should now be at this screen in Kingo:
Read through King's Root Notifications, then click the orange ROOT button when you're ready. This step may take a few minutes, and once it's successful, you should see this screen:
Click the Finish button and reboot your GS4.
Step 5: Verify Root with Root Checker
Download joeykrim's very popular Root Checker app from Google Play, which verifies whether your device has root or not.
Open up the app then tap on the Verify Root Access button. A Superuser request should pop up, so select Grant.
You'll now see the words that every softModder wants to see on their Android phone: "Congratulations! This device has root access!"
You're Rooted! Now What?
With root privileges on your device, you can now install apps and mods that require root access. One of the most popular modifications to install is the Xposed framework. It's quite simple to install, and once it's on your phone, you can add all sorts of mods and customizations.
If you have any questions, or had any trouble with this rooting method, feel free to ask for help in the discussion section below.