When NumPy is built, a configuration file is constructed and placed as config.h in the NumPy include directory. This configuration file ensures that specific macros are defined and defines other macros based on whether or not your system has certain features. This file is private, and is not exported by numpy (that is a python extension which use the numpy C API will not see those symbols), to avoid namespace pollution.
Some of those defines have a public equivalent, which are defined in numpyconfig.h (included in ndarrayobject.h). The public symbols are prefixed by NPY_*.
The NPY_SIZEOF_{CTYPE} constants are defined so that sizeof information is available to the pre-processor.