To quit is to voluntarily stop or give up. Often, it is specifically used to talk about resigning from a job.
Maurice knew that he had to quit smoking soon, otherwise he was at risk of any number of health problems. He knew the facts, knew the dangers, but he was addicted to cigarettes.
Benjamin had had enough. His boss, Frieda, had been berating and criticising his performance privately for months, and now she had started doing it in front of other employees. Today, when she started on him, he stood up, put his coat on, said that he was quitting, and left. We all cheered for him.
An idiomatic way to say you are going to stop doing something is to say you are going to call it quits. If you have decided to stop doing something while you are still successful at it (before your luck changes), you can say that you will quit while you're ahead.
Paul said that the hardest decision he'd ever had to make in his life was when he and his wife decided to call it quits. Getting divorced when you have five children can't be easy, and I know it wasn't easy for them.