You're asking some questions that don't have simple answers. These quirks of etiquette aren't laid down in any law or code; they're mostly convention.
When someone in government refers to a public official, they use government protocol. Media, on the other hand, will use a style guide that might have different rules. Everyone else simply uses etiquette.
Usually individuals are referred to by their highest ever title in protocol but their most recent title in style guides and common use.
Certain elected offices confer lifetime titles. We refer to presidents as "President Lastname" forever, though usually in first usage we call them "Former President Lastname" and then "President Lastname" thereafter.
Hilary Clinton's title is a little more complicated. How presidential candidates are referred to in public and in the press matters a lot to campaigns since it can influence public perception. Clinton used her first name in campaign materials, but also made use of "Senator Clinton" and "Secretary Clinton" at other times. Protocol would dictate "Secretary", but style guides might suggest simply "Mrs." since she currently holds no office.
As for the General Kelly question, a comparison might be to medicine. When someone becomes a doctor, they are "Dr. Name" forever. If they're made chief of surgery, you don't call them "Chief of Surgery Name," they're still "Dr. Name" because the job title isn't necessarily a title for a person. "General" is a title, and usually a lifelong one at that, like Doctor. Chief of staff is simply a position. If a person's only ever job was chief of staff, they'd be called "Mr./Mrs. Name, Chief of Staff," never "Chief Name."
The short answer: it's complicated, and there are no simple rules.