Digital therapeutics, enabled by advanced machine learning algorithms and medical wearable devices, offer a promising approach to streamline diagnostics and improve access to healthcare. Within this framework, automatic sleep scoring can provide accurate and efficient sleep analysis from electrophysiological signals recorded with wearable sensors, such as electroencephalography (EEG). However, the optimal configuration and temporal dynamics of automatic sleep scoring systems remain unclear, especially concerning their performance across different population samples. This study systematically investigates the impact of electrode setup, temporal scope, and population characteristics on the performance of automatic sleep scoring algorithms. Utilizing a convolutional neural network (CNN) model, we analyzed various electrode configurations and temporal dynamics using datasets comprising both healthy participants and individuals with sleep apnea. Our findings reveal that sleep scoring based on a single frontal EEG channel demonstrates reliable congruency with human expert scorers, with minimal improvement observed with additional sensors. Moreover, we demonstrate that real-time sleep scoring can be achieved with comparable accuracy to offline methods, which rely on past and future information to classify a window of interest. Remarkably, a notable reduction in decoding accuracy is observed for individuals with sleep disorders compared to healthy participants, highlighting the challenges inherent in accurately assessing sleep stages in clinical populations. Digital solutions for automatic sleep scoring hold promise for facilitating timely diagnoses and personalized treatment plans, with applications extending beyond sleep analysis to include closed-loop neurostimulation interventions. Our findings provide valuable insights into the complexities of automatic sleep scoring and offer considerations for the development of effective and efficient sleep assessment tools in both clinical and research settings.