It should be noted that the naming of ships after people isn't anything new - the USS John F. Kennedy (CV-67), which preceded the USS Nimitz, was named after a person. Same for the USS Forrestal (CV-59), the world's first supercarrier.
Even before that, the *Essex-*class carrier USS Franklin (CV-13) was named after Ben Franklin, despite most Essex-class carriers being named after historical American battles (another exception was the USS Randolph, named after Peyton Randolph, who lead the First Continental Congress)
This link from the Navy's historical command (official navy.mil website) states:
On 3 March 1819 an act of Congress formally placed the responsibility for assigning names to the Navy's ships in the hands of the Secretary of the Navy, a prerogative which he still exercises.
Interestingly, the rules were originally laid out as:
This act stated that "all of the ships, of the Navy of the United States, now building, or hereafter to be built, shall be named by the Secretary of the Navy, under the direction of the President of the United States, according to the following rule, to wit: those of the first class shall be called after the States of this Union; those of the second class after the rivers; and those of the third class after the principal cities and towns; taking care that no two vessels of the navy shall bear the same name." The last-cited provision remains in the United States Code today.
It then states, that at the turn of the century:
Shortly before the turn of this century the legislation was changed to reflect the remarkable changes taking place in the Navy itself as wooden hulls, sails, and muzzleloading ordnance gave way to steel ships with breechloading rifles. An act of May 4, 1898, specified that "all first-class battleships and monitors [shallow-draft coast-defense ships completed between 1891 and 1903, armed with heavy guns] shall be named for the States, and shall not be named for any city, place, or person, until the names of the States have been exhausted, provided that nothing herein contained shall be construed as to interfere with the names of states already assigned to any such battleship or monitor."
For aircraft carriers:
During World War II the names of individuals were once again assigned to aircraft carriers. A small fleet carrier (CVL 49), converted from a cruiser hull, was named Wright in honor of the Wright brothers, while a large aircraft carrier (CVB 42) of the Midway class was named Franklin D. Roosevelt soon after the President's death in the spring of 1945. That name was suggested to then-President Harry S. Truman by Secretary of the Navy James Forrestal, who would himself later be honored in the naming of our first "supercarrier," Forrestal (CVA 59). Franklin D. Roosevelt was the first aircraft carrier to be named for an American statesman; Franklin and Hancock, wartime Essex-class fleet carriers, honored the former Navy ships of those names and not, as many think, the statesmen themselves. A new Langley (CVL 27) honored our first aircraft carrier, lost in the opening months of war in the Pacific.
Finally, regarding the Nimitz-class and other supercarriers:
After World War II aircraft carriers were given a mix of such traditional carrier names as Ranger, Saratoga, and Coral Sea and names of individuals. The first of these, as we have seen, was Franklin D. Roosevelt, later followed by Forrestal and John F. Kennedy. All the ships of the current Nimitz class bear the names of such national figures as Theodore Roosevelt, George Washington, and Ronald Reagan.
Long story short, the first ship of the class sets the theme (e.g. Los Angeles class is generally named after cities, Virginia class after states, etc.) but it is not a hard line rule, and ships can be named to honor people or past ships (like the Enterprise) as deemed necessary by SECNAV under direction from POTUS
Follow up question: all US battleships were named after states except for USS Kearsarge (BB-5) (even the other ship in its class was named Kentucky). Why was this one battleship named outside of the states convention?