Note that for any flight to/from Canada, the check in/baggage cut off is 60 minutes prior to check in. Unlike domestic flights, where UA agents can check you in late (at their discretion, that doesn't mean they will), the Canadian cut-offs are very strict....IIRC, I think Canada requires this. So do not miss that.
As for how early you should get there, I guess it depends how you like to run through the regular flight process. From the US to Canada, I wouldn't worry about getting there much earlier then a regular domestic flight - it is pretty much the same as for a domestic flight (with the passport check requirement - this will happen at both check in and at the gate). Unless of course, you need to get your BP at the airport or check bags, in which case I would say at least 90 minutes to make sure there isn't a line to get your bags checked, as you don't want to miss this cut off.
Coming back, you will likely want to be there 2 hours prior due to clearing customs in YVR (unless you have GE). Have not gone through there in a while, but IIRC they now take checked bags at the counter, and so you don't need to bring it through CBP yourself. Believe its security first, then CBP. Depending on the time, lines can be long, and you want to make sure you can get through - they generally do not let people cut the line, even if their flight is about to leave (they did do this 10+ years ago). I've seen the AC counter post-CBP in YYZ with fairly long lines to re-book people who don't consider the time it takes, and it can be 1 hour plus at busy times (though maybe the kiosks they use now have reduced that).