Recently, the advancement in communications, intelligent transportation systems, and computational systems has opened up new opportunities for intelligent traffic safety, comfort, and efficiency solutions. Artificial intelligence (AI) has been widely used to optimize traditional data-driven approaches in different areas of the scientific research. Vehicle-to-everything (V2X) system together with AI can acquire the information from diverse sources, can expand the driver's perception, and can predict to avoid potential accidents, thus enhancing the comfort, safety, and efficiency of the driving. This paper presents a comprehensive survey of the research works that have utilized AI to address various research challenges in V2X systems. We have summarized the contribution of these research works and categorized them according to the application domains. Finally, we present open problems and research challenges that need to be addressed for realizing the full potential of AI to advance V2X systems.