Cognitive radio (CR) enables unlicensed users to sense for and access underutilized licensed channels (or white spaces) owned by the licensed users in an opportunistic manner. Clustering segregates nodes in a network into logical groups called clusters. In CR networks (CRNs), larger cluster size improves network scalability thereby contributing to reduced routing overhead; however, it reduces cluster stability as the number of available common channels in a cluster reduces resulting in increased number of re-clusterings and clustering overhead. This paper presents our proposed first-of-its-kind cluster size adjustment scheme based on an artificial intelligence approach called reinforcement learning. The proposed scheme adapts the cluster size with the amount of white spaces as time goes by in order to improve network scalability and cluster stability in CRNs. Due to the lack of progress in the investigation of cluster size adjustment schemes in the literature, this paper also analyzes their attributes, and then presents such schemes investigated in various kinds of distributed wireless networks. Simulation results show that our proposed scheme improves network scalability by creating larger clusters, and improves cluster stability by reducing the number of re-clusterings (i.e., the number of cluster splits) and clustering overhead, while reducing interference between licensed and unlicensed users in CRNs.