If you're coming to Orlando for the full-throttle theme park experience and nothing else, stay on-site. You'll avoid burning daylight driving to and from the park and waiting on line at the entrance gates. If you have small kids who need an afternoon nap to power through the day, staying at the park lets you take a midday break without the hassle of exiting and re-entering.
Universal Orlando has a trio of Loews Hotels and offers both regular shuttle service as well as a water taxi to and from the park area. Walt Disney World has literally dozens of Disney-owned or -affiliated hotels on its grounds at a wide variety of price points, and offers shuttle service to and from the parks. Depending on which resort you book, though, it can take upwards of an hour to get back and forth.
In both cases, visitors staying within the parks get extra perks. At Universal, hotel guests can access the Wizarding World of Harry Potter and Marvel Superhero Island an hour before the park officially opens, and they get Universal Express, which lets them skip the long lines by showing their room key. Guests at Disney hotels get access to one theme park either one hour before it opens or for up to three hours after it closes to other guests. The park and hours vary daily; Disney has an online calendar with the details.
If you don't plan to leave your chosen theme park, you might not even have to rent a car. Disney has a shuttle for airport transportation; Universal has an arrangement with Mears Transportation, the primary shuttle service for the Orlando Airport.