I know that one can determine the approximate wait time for a window of opportunity to open up for an interplanetary transfer based on the relative positions and velocities of the two planets in question. But once a window opens up, how long does it remain open? Assuming the simplest case of a Hohmann transfer with a hyperbolic escape trajectory toward the direction of the planet's velocity, how does one compute/control the amount of time in which one can depart? What factors limit it and how can expand it as much as possible?
The factor which determines the duration of a transfer window is the performance margin of the launcher or spacecraft.
The Hohmann transfer is the minimum delta-v for transfer between two circular orbits; in the strict sense the transfer window that achieves the minimum delta-v is instantaneous, but if a small amount of delta-v margin above the absolute minimum is available, the window becomes longer.
If you're looking at a porkchop plot, the point at the center of the innermost ring of the porkchop is the instantaneous window. Each contour line represents constant C3, which is closely related to the ∆v in the injection maneuver; if you have enough performance margin to reach a given contour line, the duration of the window corresponds to the width of the contour on the plot.
If you want a longer window, lighten the payload or improve the launcher. Note that if you have performance margin, you can also use it to reduce the flight time at the cost of narrowing the window; it's not unusual to fly a faster-than-Hohmann trajectory for interplanetary missions.
Launching from Earth, the rotation of the Earth also sets constraints; you need to maneuver your spacecraft from the available inclinations at your launch site to the inclination of the destination. To minimize the cost of that inclination change, you need to launch at a certain time of day. Once again, the more performance margin your launcher has, the more you can stretch that window.