The personal area network (PAN) coordinator can assign a guaranteed time slot (GTS) to allocate a particular duration for requested devices in IEEE 802.15.4 beacon-enabled mode. The main challenge in the GTS mechanism is how to let the PAN coordinator allocate time slot duration for the devices which request a GTS. If the allocated devices use the GTS partially or the traffic pattern is not suitable, wasted bandwidth will increase, which degrades the performance of the network. In order to overcome the abovementioned problem, this paper proposes the Partitioned GTS Allocation Scheme (PEGAS) for IEEE 802.15.4 networks. PEGAS aims to decide the precise moment for the starting time, the end, and the length of the GTS allocation for requested devices taking into account the values of the superframe order, superframe duration, data packet length, and arrival data packet rate. Our simulation results showed that the proposed mechanism outperforms the IEEE 802.15.4 standard in terms of the total number of transmitted packets, throughput, energy efficiency, latency, bandwidth utilization, and contention access period (CAP) length ratio.