Her surprise appearance, with her husband, Mark Kelly, began a three-hour-plus hearing that was at times contentious, exposing major differences of opinion among lawmakers, gun-control supporters and gun rights groups.