This paper considers optimal joint time, frequency, and power allocation for energy-efficient device-to-device (D2D) communications in an overlay cellular network, where multiple D2D transmitters communicate with their corresponding D2D receivers while utilizing the energy harvested from a cellular base station (BS). Due to channel estimation error and feedback delays, the channel state information (CSI) available at the transmitters is usually imperfect, which can significantly deteriorate the energy efficiency (EE) of the considered system. To mitigate the impact of imperfect CSI, we formulate a non-convex robust optimization problem for the maximization of the EE (in bits/Joule) of the system while ensuring quality of service (QoS) requirements on the minimum data rata and the minimum amount of harvested energy for cellular and D2D users, respectively. We reveal that the optimal energy-efficient D2D transmission should exhaust all the harvested energy of each D2D transmitter. Exploiting this fact, we propose an efficient iterative algorithm for obtaining the optimal solution. To strike a balance between performance and computational complexity, we further propose a low-complexity suboptimal algorithm. Simulation results show that compared with several baseline schemes, both the proposed optimal and suboptimal algorithms can significantly improve the EE of wireless-powered D2D communications under imperfect CSI. Moreover, the proposed suboptimal algorithm is close-to-optimal when the number of cellular users are small or the channel estimation error is large.