How and when to do exercises from books?
It is hard to say anything on this matter and not introduce much opinion; that being said, I will try to make this as non-biased and founded in fact as possible. Moreover, I will try to make this general to fit a large-audience and to be applicable to many types of textbooks.
The first thing you need to consider is the style of writing. I have read texts in which the examples were critical because some of the key information is only found in the examples. On the other hand, I have read texts in which there were almost no examples at all, either because the author found them unnecessary or because many examples exercises were already worked throughout the chapter, or perhaps both. I have often found that the author will make note of this early on, perhaps in a preface — to point out the obvious, if you don't understand how the author intends you to work through the textbook, ensure you didn't skip over instructions from the author.
The second thing you must consider is your own knowledge of the subject. I can sit down and read through many real analysis texts and understand everything without working any examples, but I cannot yet do this when reading in-depth analyses on other subjects such as Contour Integration or Fourier Series. Taylor the number of exercises you do to fit your needs. While the consequences of doing too many examples seem a matter of debate, the consequences of doing too few examples can quickly become apparent when you don't understand material later in the text relating directly to the examples. Lack of understanding is of course not always solved by doing more examples, but going back and working through some problems you skipped can help you figure out what critical details you missed.
A third factor is time. Life gets stressful and busy at times, and you might naturally want to do less examples during these periods to be able to cover more topics. On the other hand, you might want to do more exercises during these times to keep yourself from forgetting the material. I have yet to see a universal rule for studying as much as possible in a restricted time frame, though trial-and-error has helped many students I've worked with. If you feel cramped for time and don't feel like the strategy you've been using is working, try a different strategy.
It is probably important here to note that a strategy you have used for one text might not work for another. On top of that, different conditions in life might necessitate different reading strategies. There are many different learning styles, and not all of them might apply to you. Though I must admit the following line is opinion, I feel that I must include it: If you feel like you aren't learning as well as you could be, try something else. If you feel like your learning improves after the change, great! If not, then either keep trying new techniques or try to adjust other factors in your life that might be influencing your ability to study most effectively. Of course, it would be a folly to devote all your study time to optimizing and not to studying; I shamelessy reference XKCD:
Note that this flowchart could be considered opinion and will not guarantee success in all you aspirations.
As has already been discussed in the comments section to this question, any answer to the question will be subjective and opinion-based. What's always important to keep in mind is that methods that work for some will not work for others. If I had to give one piece of advice, it would be find out which method works for you. That said, here is how I approach these types of books.
In general, I prefer to completely finish the reading before starting the exercises. I do this because I want to make sure I understand the material covered, and for me, the best way of doing that is to do an assortment of problems on all the theorems and ideas covered. So, for example, suppose the chapter talks about Theorem A, Corollary B, Theorem C, and Theorem D. If I were to do the exercises concerning Theorem A and Corollary B immediately after reading about them, I would probably forget about them after I have finished the reading (and done the exercises) for Theorems C and D. So, instead I finish all of the reading and then do all of the problems. Then, I review the problems that I am unable to solve and the theorems, properties etc. concerning them.
This method works best with shorter chapters or sections (no more than 20 pages long). For slightly longer sections (like the 50-page sections you mention), I like to read some of the chapter and then do a sampling of exercises before completing the reading. So, for your case I might read 20-25 pages, then do 5-10 of the first 20 exercises in the exercises section just to make sure I understand the concepts that I learned in the first half. Then, I would finish the reading and solve all of the other exercises. I find that this method works very well with longer chapters (as long as there are sufficient exercise problems, which in your case is not a problem).
To further reinforce my understanding of the topic, I like to circle questions that I answered incorrectly the first time and then come back to them a couple of days or a week later. If I am still unable to do the question, I circle it a second time and reread the relevant theorems. I repeat this process until I understand the question and the relevant concepts.
Hope this helped! :)