Increasing concerns on intelligent spectrum sensing call for efficient training and inference technologies. In this paper, we propose a novel federated learning (FL) framework, dubbed federated spectrum learning (FSL), which exploits the benefits of reconfigurable intelligent surfaces (RISs) and overcomes the unfavorable impact of deep fading channels. Distinguishingly, we endow conventional RISs with spectrum learning capabilities by leveraging a fully-trained convolutional neural network (CNN) model at each RIS controller, thereby helping the base station to cooperatively infer the users who request to participate in FL at the beginning of each training iteration. To fully exploit the potential of FL and RISs, we address three technical challenges: RISs phase shifts configuration, user-RIS association, and wireless bandwidth allocation. The resulting joint learning, wireless resource allocation, and user-RIS association design is formulated as an optimization problem whose objective is to maximize the system utility while considering the impact of FL prediction accuracy. In this context, the accuracy of FL prediction interplays with the performance of resource optimization. In particular, if the accuracy of the trained CNN model deteriorates, the performance of resource allocation worsens. The proposed FSL framework is tested by using real radio frequency (RF) traces and numerical results demonstrate its advantages in terms of spectrum prediction accuracy and system utility: a better CNN prediction accuracy and FL system utility can be achieved with a larger number of RISs and reflecting elements.