If it’s a multi-gun rack, yes, you should hang it from a stud. Because of the weight of the rack itself plus the weight of the guns, it’s safer and more practical to screw the rack into a wall stud. Use a stud finder to make your job easier.