The Internet of Things (IoT) has been considered as an emerging research area where the IPv6 over low-power wireless personal area network (6LoWPAN) protocol stack is considered as one of the most important protocol suite for the IoT. Recently, the Internet Engineering Task Force has developed a set of IPv6-based protocols to alleviate the challenges of connecting resource limited sensor nodes to the Internet. In 6LoWPAN networks, heavy network traffic causes congestion which significantly degrades network performance and effects the quality of service aspects, e.g., throughput, end-to-end delay and energy consumption. In this paper, we formulate the congestion problem as a noncooperative game framework where the nodes (players) behave uncooperatively and demand high data rate in a selfish way. Then, the existence and uniqueness of Nash equilibrium is proved and the optimal game solution is computed by using Lagrange multipliers and Karush-Kuhn-Tucker conditions. Based on this framework, we propose a novel and simple congestion control mechanism called game theory-based congestion control framework (GTCCF) specially tailored for IEEE 802.15.4, 6LoWPAN networks. GTCCF is aware of node priorities and application priorities to support the IoT application requirements. The proposed framework has been tested and evaluated through two different scenarios by using Contiki OS and compared with comparative algorithms. Simulation results show that GTCCF improves performance in the presence of congestion by an overall average of 30.45%, 39.77%, 26.37%, 91.37%, and 13.42% in terms of throughput, end-to-end delay, energy consumption, number of lost packets, and weighted fairness index (WFI), respectively, as compared to duty cycle-aware congestion control for 6LoWPAN network algorithm.