The GT40 was originally produced to win long-distance sports car races against Ferrari (who won at Le Mans six times in a row from 1960 to 1965). The car was named the GT (for Grand Touring) with the 40 representing its overall height of 40 inches (1.02 m, measured at the windshield) as required by the rules. Large displacement Ford V8 engines (4.2 litre, 4.7 litre and 7 litre) were used, compared with the Ferrari V12 which displaced 3.0 litres or 4.0 litres.
Early cars were simply named "Ford GT". The name "GT40" was the name of Ford's project to prepare the cars for the international endurance racing circuit, and the quest to win the 24 Hours of Le Mans. The first 12 "prototype" vehicles carried serial numbers GT-101 through GT-112. The "production" began and the subsequent cars, the MkI, MkII, and MkIIIs, (with the exception of the MkIV, which were numbered J1-J10) were numbered GT40P/1000 through GT40P/1145, were officially "GT40s". The name of Ford's project, and the serial numbers dispel the story that "GT40" was "only a nickname."
Source: Wikipedia (original)