United Airlines MileagePlus miles never expire as long as your account is open and in good standing.
Previously, United miles expired 18 months after account inactivity, so the current policy is a nice improvement.
However, you should regularly redeem your United miles because airlines regularly devaluing their points.
Comparison of U.S. Airlines' Policies
Below is the mileage expiration policy for every major U.S. airline.