Assuming you are US citizen no visas.
In the UK they will ask why you are there - you say "in transit."
They say "in transit to where?" Tell them "Italy via Gatwick." They stamp passport, write "IT" on stamp, you are on your way.
In Italy they won't ask you anything just give you a stamp.
Italy will stamp on exit of the country. UK does not.
You should wind up with 4 stamps total - 2 entries for UK, 1 entry and 1 exit for Italy.