The sliding mode control is well-known as a useful control technique that can be applied in several real-world applications. However, a straightforward and efficient process of tuning the gains of a sliding mode controller remains a challenging but interesting topic. In this paper, a mathematical method for the sliding mode controller gain tuning is investigated. Firstly, we obtain relations between the gains and the natural and damping ratio of the closed-loop system. Secondly, the time constant of the system's actuators and the system response performance criteria, including settling time and delay time, are taken into consideration to determine the gains. In addition, appropriate gain ranges, which ensure that the system performance is met and the actuators work properly, are derived. Finally, the proposed method is applied to the gain tuning process of a sliding mode altitude controller for an actual quadcopter unmanned aerial vehicle. Simulation and experimental results demonstrate the applicability and effectiveness of this method.