IEEE 802.15.4 supports a Guaranteed Time Slot (GTS) allocation mechanism for time-critical and delay-sensitive data transmissions in Wireless Personal Area Networks (WPANs). However, the inflexible first-come-first-served GTS allocation policy and the passive deallocation mechanism significantly reduce network efficiency. In this paper, we propose an Adaptive and Real-Time GTS Allocation Scheme (ART-GAS) to provide differentiated services for devices with different priorities, which guarantees data transmissions for time-sensitive and high-traffic devices. The bandwidth utilization in IEEE 802.15.4-based PAN is improved. Simulation results show that our ART-GAS algorithm significantly outperforms the existing GTS mechanism specified in IEEE 802.15.4.