I haven't connected between the two but I fly US constantly and UA every now and then.
From US, AT MOST (and likely much less):
5 minutes to walk to sidewalk outside terminal
10 minutes at most to catch the Port Authority/LGA shuttle bus (they run every 10-15 minutes, but there are multiple routes)
5 minute bus ride
5 minutes to get to UA security
20 minutes max at security, I'd guess
5 minutes to get to the gate
For the reverse: the shuttle buses run from US to UA terminals- not directly from UA to US (they go around the airport). UA to US terminal is certainly walkable- maybe 5-10 minutes.