I will arrive at Heathrow on a Sunday at 2:50 PM. I hope to make a connecting flight out of Gatwick at 6:05 PM. Is this doable?
Possible but really, really tight ... it takes about an hour to get from Heathrow to Gatwick.
I think the variable will be how long the passport control line is at Heathrow and does your flight land on time at Heathrow.
I had a similar time window out of Stansted last May. After thinking about all that could happen to delay me, I opted for a later flight out of Stansted. As it turned out, though, my flight into Heathrow was a little early, I got an earlier bus, and could have easily made the earlier flight. Still... it's risky. I'd look for a later flight out of Gatwick just to be on the safe side.
If you check bags, I don't think you'll realistically have a shot. If you don't check bags, I think you still stand to miss your flight unless everything works perfectly.
We decided against that kind of connection during travel in October. You have barely three hours, though really less than two, since you need to check in at least an hour before departure. I usually allow three hours for an international connection in the same airport, though in October we were ready for our connecting flight at LHR in a little over an hour from time of arrival at the gate.
If you are not checking any bags, you might make it. But any problem at all will doom you to failure: late arrival at LHR, slow baggage unloading, passport clearance, heavy traffic, etc., etc. The only thing in your favor is arriving on Sunday, when traffic might be less than during the work week.
Personally, I would not try it. Good luck.
If your flight out of Gatwick is on a budget airline, the consequences of mssing your flight are eating the price of your ticket and having to buy a new one for a later flight at a very high price.