How to travel between two stationary worlds in the least amount of time? (time dilation)

Suppose that A and B are at rest relative to each other (which you have) and in their mutual rest frame are separated by 100 light years. That means that no signal can travel from A to B (or vice-versa) in less than 100 years. Signals include optical or radio signals, which travel at the speed of light, and also material projectiles like spacecraft, which are slower.

So, if you leave in your spacecraft when you receive, at A, a signal that says "what to expect on planet B now that it's the year 2019," the earliest you can arrive at B is their year 2219. The message you got was old, and it takes time for you to arrive.

Time dilation has the effect of compressing the time in your trip. On your way from A to B, you'll receive 200 years worth of their news broadcasts: the 100 years' worth that were already in transit to you when you left, and the (at least) 100 years' worth that are emitted while you are en route. But if you travel with a relativistic factor $\gamma=(1-v^2/c^2)^{-1/2}=100$, you'll only have about a year to study all of that news.

There's no problem of traveling "too fast". It's true that the faster the space ship goes, the faster time will pass for the inhabitants of World B relative to how fast time passes for the spaceship traveler - but that's unimportant and not relevant to your question above. What your question is concerned with is the amount of time that time passes on World B (regardless of how much time passes on the space ship) by the time the space ship reaches it, and the way to minimize that total amount of time that passes on World B is for the space ship to travel to it as fast as possible (i.e., as close to light speed as possible).

The first thing to get out of the way: you will never ever get there faster than light. If the planets are separated by 100 light years of distance, there's no way to make the trip in less than 100 years. If you first need to detect the life, double that - light needs to travel to you with the information, and then you need to travel back to them.

Now, what is the travel time for a spaceship between the two planets on relativistic speeds? Exactly the same as with non-relativistic speeds. If your speed is 0.1c, the trip will take you 1000 years. If your speed is 0.5c, the trip will take you 200 years. The only thing that relativity changes is your passage of time, not the target planet's. So you don't ever have to worry about "going too fast" - the faster you go, the sooner you arrive. Assuming you can actually go that fast, of course. The main trick of relativistic travel is that you experience time differently, so if you had a spaceship that could continuously accelerate at 1g, you'd eventually get to a speed where from your point of view, any trip would be just about the acceleration (to almost c and back) - you could just as easily reach the next star cluster over as the next galaxy over. You only really see the difference when you do a roundtrip, and realize that your four years on the spaceship actually meant a hundred million years at home :P (this is a pretty common plot in relativistic "time travel" sci-fi stories).

The only thing you have to worry about is the acceleration. Assuming you can only get a constant subjective acceleration throughout the trip (which is already extremely generous, mind you), the maximum speed you can achieve depends on the acceleration and distance. If you consider this case, higher speed would necessarily mean the planets are further away, and so you would arrive "later" (as far as the target planet is concerned). This might be what you originally referred to as "going too fast" - it's again a common sci-fi story. It has no effect if you only ever care about travel between two stationary planets A and B.

So, what about your premise, then? The main trouble is the roundtrip. First, you have to detect the life on the distant planet. This will probably mean something like picking up their radio. At the point you detect the transmission, it's already 100 years since it's been transmitted - if you launch your ship at 0.999c right away (no acceleration time etc.), you'll arrive on the target planet 200 years after the transmission was made. The tricky part is that if human civilization is representative of reasonably typical development, the guys likely went from sending their first radio transmissions to going to space in less than half that time (on Earth, it took 75 years, if you go from the extreme "first radio ever" to "first human in Earth's orbit").

So if you want to visit them before they reach space, and assuming they have the same progress as we did, you'd only be able to deal with planets ~40 light years distant. Or, you can relax your requirement a bit, and want to visit them before they can do interstellar travel - which is something so far outside of our current capabilities we're not even sure it would ever be anywhere close to practical. At the very least, it should give you extra hundred years (50 ly distance) or so. But don't forget that this is still with essentially magic-level technology - technically possible with what we know about the universe, but beyond any engineering we can realistically imagine. There's a reason why so many space stories choose to use a magic FTL drive of some sort - space is big.