It means both things. Though, conversationally, impertinent is used more for someone who is not showing the appropriate level of respect to a superior or an elder. It is not only used for people but things, such as an impertinent reply or an impertinent regard.