Humans need sleep to function productively. However, these five factors, including sleep apnea, can affect your sleep quality and duration.