We report the discovery of a 206 ms pulsar associated with the TeV gamma-ray source HESS J1640-465 using the Nuclear Spectroscopic Telescope Array (NuSTAR) X-ray observatory. PSR J1640-4631 lies within the shell-type supernova remnant (SNR) G338.3-0.0, and coincides with an X-ray point source and putative pulsar wind nebula (PWN) previously identified in XMM-Newton and Chandra images. It is spinning down rapidly with period derivative Pdot = 9.758(44)E-13, yielding a spin-down luminosity Edot = 4.4E36 erg s-1, characteristic age = P/2Pdot = 3350 yr, and surface dipole magnetic field strength Bs = 1.4E13 G. For the measured distance of 12 kpc to G338.3-0.0, the 0.2 - 10 TeV luminosity of HESS J1640-465 is 6% of the pulsars present Edot. The Fermi source 1FHL J1640.5-4634 is marginally coincident with PSR J1640-4631, but we find no gamma-ray pulsations in a search using 5 years of Fermi Large Area Telescope (LAT) data. The pulsar energetics support an evolutionary PWN model for the broad-band spectrum of HESS J1640-465, provided that the pulsars braking index is approximately 2, and that its initial spin period was Po ~ 15 ms.