Physicist: A good way to think about a wormhole is as a single region of space. That is, while the ends may be in two different locations, the wormhole itself is a single “piece of space”.
So, even if you move the entrances far apart, the distance you travel from one side to the other always stays the same. Similarly, even if you move the entrances far apart in time, the time it takes to get across them stays the same in very much the same way.
That shouldn’t make much sense (if it did, sober up), but here’s the idea:
The two ends of the wormhole will always be connected to each other such that they’re always connected at the “same age”. So, if you enter one end 5 years after the creation of the wormhole, you’ll exit the other end 5 years after the creation of the wormhole, no matter where the ends are located.
Two synced clocks on opposite sides of a room will stay synced up. The nature of the space between them isn’t particularly important. For example, if the space between them is, say, a wormhole instead of a sitting room, they’ll still stay synced up.
This has exciting potential for time-machine building. If you can somehow get one side of the wormhole to experience more or less time, from an outside perspective, then, from that outside perspective, you’ll have a difference in ages between the ends of the wormhole.
Luckily, relativity (both special and general) gives us some tricks for slowing down the amount of time an object experiences. Taking advantage of the twin paradox (special relativity), you can take one end of the wormhole and move it (never mind how) at very high speeds for a while. When it’s brought back to rest, its clock will register less time than its stationary counterpart. Alternatively, you can take advantage of gravitational time dilation (general relativity). Time moves “slower the lower“. So, if you park one end of the wormhole in orbit around a black hole or something else heavy, then it will also experience less time.
So, say you’ve created a wormhole. Never mind how. You take entrance B, attach it to a ship and fly it around at nearly the speed of light (doesn’t matter where), and then bring it back, while entrance A sits still. While entrance B experiences 5 years (for example), entrance A experiences 5,000 years (for example). Now you’ve got two entrances, but one is 5 years old and the other is 5,000. Since they’re “connected at the same age”, stepping through the B entrance will take you back to the time when the A entrance was 5 years old, which was 4,995 years ago. Similarly, stepping through the A entrance would take you to the time when the B entrance is 5,000 years old, 4,995 years in the future (assuming there’s no further wormhole moving). In the picture above A is on the left and B is on the right.
As for how exactly the mechanics of time travel works, what with grandfather paradoxes and what not, I couldn’t say. That’s more of an “ask a sci-fi writer” sort of thing.
The methods used to create, stabilize, and move wormholes generally involve some pretty abstract (“abstract” = “impossible”) math and physics. General relativity, among other things, gives us a way of relating the curvature of space to the distribution of matter and energy in that space. So, for example, you can figure out how the presence of a star’s worth of mass will affect the spacetime around that star.
Alternatively, you can back-solve. You take the weird spacetime of a stable wormhole, do a mess of math to figure out how you’d need to arrange matter, and find that in general wormholes need a whole lot of negative energy and matter. The drawbacks of negative matter, sometimes called “exotic matter”, are: 1) it’s very difficult to work with and 2) it doesn’t exist.
However, the tricks used to slow down time are legitimate science! Here’s a fun home experiment: Find yourself a merry-go-round. One of the big ones, with the horses and the brass band and whatnot. The twin paradox applies to anything that makes a round trip. So, every time you make a full turn you’ll have experienced about 0.4 femtoseconds (0.0000000000000004 seconds) less than everyone else. That’s forward time travel!
But be warned, you’ll be cursed to live in the future forever. Never able to go back and warn people about the misfortunes of their extremely near futures.