The key principle of physical layer security (PLS) is to permit the secure transmission of confidential data using efficient signal-processing techniques. Also, deep learning (DL) has emerged as a viable option to address various security concerns and enhance the performance of conventional PLS techniques in wireless networks. DL is a strong data exploration technique which can be used to learn normal and abnormal behavior of 5G and beyond wireless networks in an insecure channel paradigm. Also, since DL techniques can successfully predict future new instances by learning from existing ones, they can successfully predict new attacks, which frequently involve mutations of earlier attacks. Thus, motivated by the benefits of DL and PLS, this survey provides a comprehensive review that overviews how DL-based PLS techniques can be employed for solving various security concerns in 5G and beyond networks. The survey begins with an overview of physical layer threats and security concerns in 5G and beyond networks. Then, we present a detailed analysis of various DL and deep reinforcement learning (DRL) techniques that are applicable to PLS applications. We present the specific use-cases of PLS design for each type of technique, including attack detection, physical layer authentication (PLA), and other PLS techniques. Then, we present an in-depth overview of the key areas of PLS where DL can be used to enhance the security of wireless networks, such as automatic modulation classification (AMC), secure beamforming, PLA, etc. Performance evaluation metrics for DL-based PLS design are subsequently covered. Finally, we provide insights to the readers about various challenges and future research trends in the design of DL-based PLS for terrestrial communications in 5G and beyond networks.