Inelastic neutron scattering experiments were performed to investigate the crystalline electric field (CEF) excitations of Nd3+ (J = 9/2) in the iron pnictide NdFeAsO. The crystal field level structures for both the high-temperature paramagnetic phase and the low-temperature antiferromagnetic phase of NdFeAsO are constructed. The variation of CEF excitations of Nd3+ reflects not only the change of local symmetry but also the change of magnetic ordered state of the Fe sublattice. By analyzing the crystal field interaction with a crystal field Hamiltonian, the crystal field parameters are obtained. It was found that the sign of the fourth and sixth-order crystal field parameters change upon the magnetic phase transition at 140 K, which may be due to the variation of exchange interactions between the 4f and conduction electrons.