And UA is generous in this regard -- most other airlines don't have any cancellation window.
In the U.S. most every airline has a 24-hour hold or cancellation policy.
They were threatened with regulation if they didn't have some such policy, so they came up with these policies "on their own."