The Internet of Things (IoT) is a new technology that has drawn interest from both industry and academia in the modern digital era. The IoT provides a platform for any device to connect and share data over the Internet. Because of the diverse IoT environment and resource-constrained IoT devices, this nascent technology has numerous security challenges. Due to the lack of fine-grained access control and flexibility, traditional cryptographic algorithms such as private key encryption and public-key encryption are not suitable for providing access control mechanisms. ABE (Attribute-Based Encryption) is a new cryptographic approach that not only provides security but also fine-grained access control. This paper provides a comprehensive survey of ABE and its various forms, such as key policy ABE and ciphertext policy ABE, based on access structure, multi-authority, and hierarchy features. Further access structures used in ABE and applications of the ABE technique in IoT are also discussed. A comparison of different ABE schemes is presented regarding features, efficiency, and security. In addition, numerous schemes are analyzed to uncover obstacles, issues, and gaps that need to be investigated further.