Okay, this is common.
You have all those backstory things that you think need to be told.
The trick is that you only need the ones that help move this story forward. Anything beyond that becomes you--the writer--indulging yourself and overloading the reader with too much information (TMI).
Cut it off when you grow tired of it or when you decide you need to get back to the real story. However, plan on revisiting that section so you can throw out all the unnecessary stuff that doesn't help move the story forward and that the reader really doesn't need to know yet.
I usually throttle it as quickly as I can; though sometimes I end up with length backstory pages that I'm sure the reader will never realize that I cut 80% of what I wanted to say and though I actually wrote 50% of it and ignored 50% and then cut the 30% later. If that makes sense to you.
Only you know where you should stop and then what you need to cut and what needs to stay in order to round out the narrative.
However, try to stop the madness ASAP so you can finish the real story and if you have to you can go back and edit detail into and out of it all.
It might also depend on whether they are telling the backstory to the reader only or if it is something told to another character who will be able to recall this some time in the future and it is vital to the story. It's your story and you know it best so use your best judgement.
You might cut it short and then twenty pages on something stops you dead because you haven't told the reader something and you may then have to make sure you get that into the mess.
Bottom line though, some things in your head should never go on the page.
At least that's the way it is for me.
Another thought;
If you get it out of your system you can take your twenty some pages and set them off to the side and mark off key points and then see if there are ways to pepper the information into the narrative throughout the whole so that you have a sentence here and another there and it never adds up to more than a paragraph on any single page and it somehow fits into what is happening at the time.
Events that key thoughts about the past.