When you self-connect (book the flights separately), the issue is that if you do not check-in in time for the second flight (i.e. before the check-in deadline, which is 1 hour for UA at EWR), you're considered a no-show, and the airline is quite likely to cancel your ticket, including any further segments on the same ticket (e.g. a return flight).
In that case, you have to rebook a new flight, at your expense, at last minute prices (often much more expensive), and if you need to spend the night, any hotels, meals, transfers will be for you to pay as well. If the two flights were on a single ticket, all of that would be the airline's responsibility.
When the second flight is a frequent and cheap flight, one can easily take the risk. When it's an unfrequent and more expensive flight, the risk is quite different. It's up to you to decide whether you are willing to take that risk.
If all goes well, 4.5 hours to do this (which is really 3.5 hours from plane to check-in, which is usually the critical path) should be more than enough:
- You have 3.5 hours to:
- Deplane
- Go to baggage claim and claim your bag
- Go to departures
- Queue and check-in
- You then have at least around 30-45 minutes (United is not very precise about this) to:
- Go through security
- Get to your gate before boarding ends
Realistically, I would think that if the first flight is on time, even 2 hours should be more than enough.
The issue is what happens if the first flight is delayed or cancelled. With a total of 4.5 hours, you have a buffer of about 2.5 hours. That should cover most small delays, but not the larger ones, and probably not the case of a cancelled flight.
If you can, book the whole itinerary as a single ticket and make that the airline's problem. If the international flight is already booked, check with the airline if it can be changed.
If you cannot, it's up to you to judge whether you can afford the risk incurred. If you're travelling on any kind of peak period (holidays for instance), or during periods where significant disruption can be expected (snow storm in NYC for instance), the risk of significant delays and/or high costs to rebook can be quite high, so factor that in.