Under most circumstances the examiner can make a second rejection a "final rejection". After a final rejection you can keep the process going by filing an RCE (request for continuing examination) along with your response. While there is no fee to respond in a timely manner to a rejection, there is a fee to file an RCE. A second or subsequent RCE fee is a little higher. So, generally, for every second rejection there would be an RCE fee. Technically there is no limit to the right to file RCE's. At one point several years ago a former director of the USPTO tried to make a rule limiting the number of RCE's filed in a case but it was struck down in court.
There are points in the process were the applicant is entitled to an interview with the examiner and examiners are encouraged to participate in interviews even at points when it is not required. An interview is usually restricted to 30 min. and don't expect more than one interview per office action.
The book "Patent it Yourself" by David Pressman can be helpful in learning the basics of drafting a patent application and responding to office actions. You can also learn by looking at the whole history of the back-and-forth between the applicant and examiner and any patent granted in the last several years at Public PAIR.