Building codes require deck railings for decks that are more than 24 inches off the ground. If stairs exist, then these are considered for adding a railing.