About how long does it take to treat back and hip pain with a tens machine?

On regular basis. Tens is producing pain relief as long as you apply it on the paiful areas. Therefore for long-term management you need the unit at home.
Depends on diagnosis. Tens (transcutaneous electrical stimulation) is a non-invasive way of treating various painful disorders. It essentially drowns out pain stimulus. Its effectiveness or duration of needed treatment depends on the underlying condition. Back pain can be caused by a multitude of disorders, and a general statement cannot made regarding the use of tens unit.