This paper studies how to maintain real-time data freshness in the emerging wireless powered communication networks (WPCNs). In a WPCN, one or multiple hybrid access points (HAPs) with constant power supply transfer the energy and receive the status update through wireless to and from a set of distributed sensor nodes simultaneously. We utilize the concept of Age of Information (AoI) to quantitatively measure the freshness of the sensor data, and formulate the AoI optimization problem. Based on this problem formulation, we first explore the optimal time allocation method to minimize the average AoI for sensor nodes in single-hop WPCNs. This method is then extended to derive the optimal time allocation for two-hop WPCNs, where some sensor nodes may transmit status update to the HAP through relay nodes. In this more complex scenario, we apply a two-phase method to 1) identify all the two-hop node candidates and their associated relay nodes, and 2) determine the best assignment and the corresponding time allocation to optimize the average AoI. A 5-node WPCN testbed is developed to validate the functional correctness of the proposed methods. Extensive simulations are also conducted for performance evaluation under more comprehensive settings. The experimental results show that the proposed methods can reduce the average AoI by 83.4% on average compared to the state-of-the-art methods.