I've read many articles and attempts to answer this question.
Some researchers look for references to "Moab" within the text of Judges (arriving to Ehud). Others search for a famine from history that might explain why Elimelek and Naomi would leave with their family from Judah to Moab (with many often forgetting that it was a regional famine in Canaan which was apparently not quite so bad in nearby Moab).
I've seen many estimates that range from the time of Ehud all the way to the time of Samson. Yet, in many of these estimates, I feel that most seem to be making any estimate far more complicated than it should be. After all, it can be a question of simple math.
Boaz --> Obed --> Jesse --> David
These are the generations from Ruth to David. Ruth was still quite young. After all, she was likely much younger than "kinsman redeemer" Boaz given Boaz's surprise that Ruth would be interested in marrying him rather than younger men (Ruth 3:10). She was also young enough to have been a viable partner in case Naomi was blessed with other sons who would have grown (Ruth 1:12-13).
Yet, even here, estimates of the ages of Boaz and Ruth are inconsequential. Rather, the focus is on the span of time between the birth of Obed and the birth of David. There were only TWO people born between Boaz and David. Obed was David's grandfather and Jesse was David's father.
Unfortunately, we aren't told how old either men were. We do know that David was Jesse's youngest son at the time Samuel anointed David to be king. So, Jesse was likely a bit older by the time David was born. However, Jesse was still alive when David left his father and mother in Moab (I Samuel 22:3-4). This was while Saul was still chasing David.
Interestingly, we never read about David later bringing his father and mother back from Moab. Thus, it is possible that they may have died there. There is a tradition that Jesse died and buried in Hebron; however, this claim (and the tomb) is somewhat dubious (with the earliest recorded references of that tomb dating back to less than 800 years ago).
What does this mean?
In order to answer the original question, all we need to do is ascertain the time period between the births of Obed and David.
Using older ages for birth (and the fact that David was Jesse's youngest son), we can guess the following time frame:
Obed -- 40 years old --> Jesse -- 55 years old --> David
This would place about 95 years between the birth of Obed and the birth of David. Obviously, we don't know how old Obed was when Jesse was born. Nor do we know how old Jesse was when David was born. This is just a "guess-estimate."
David was still a youth when Samuel anointed him as king. Samuel was VERY old. After all, he was called "old" by the people when they asked for a king prior to the anointing of Saul (I Samuel 8:1-5).
Again, let's guess that Samuel was 70-years-old when the Israelites asked for a king. That would make him roughly 85-years-old when he anointed David (give or take some years).
When Samuel died (I Samuel 25:1), we are not told Samuel's age or how many years that he judged Israel. However, we do know that Eli died at the age of 98 and had judged Israel for 40 years. We can assume that Samuel became Israel's judge after the death of Eli. He was a judge until his death when the people rejected his two sons that Samuel tried to set up as judges (I Samuel 8:1-15).
With this in mind, let's guess-estimate this timeline of Eli and Samuel:
Eli -- 40 years --> Samuel -- 45 years --> David (anointed by Samuel)
This estimate would mean that Eli and Samuel had judged Israel for 85 years by the time David was anointed by Samuel (which possibly took place when David was around 15-years-old).
So, using the earlier timeline between Obed and David (and accounting for the 15 years of age when Samuel anointed David), we get a rough estimate:
105 years between Obed's birth and David's anointing (at an age of 15).
We guess-estimate that Samuel judged Israel for 45 years before anointing David.
The Bible lists Eli as having judged Israel for 40 years (I Samuel 4:12-18).
Thus, this method of guess-estimates would mean that Obed was born approximately 20 years before Eli became a Judge (i.e., the difference between 105 years between Obed and David's anointing and the 85 years of time with Eli and Samuel serving as judges).
Eli was 58-years-old when he became a judge (i.e., 98-years-old at death minus 40-years as judge). So, simply put, Obed would have been roughly born when Eli was about 38-years-old. He was likely serving in the Tabernacle at the time of Boaz and Ruth.
So, the estimates that the Book of Ruth took place during the time of Ehud (or any of the early judges) is really a mathematical improbability. With this in mind, my math-chronology guess-estimate is that the Book of Ruth took place in the time between Samson and Eli the Judge.