You are confusing customs and immigration.
Customs is the check on goods. What you have in your luggage, whether it is allowed into the country and whether and customs duties (taxes) have to be paid. Customs takes zero time as most people are not stopped.
The EU is a customs union. There is no customs between EU countries.
Immigration (aka Passport Control) is the check on people, whether they are allowed into the country and for how long. This is where they stamp your passport if necessary. Immigration can take 30-90 minutes depending on how busy they are.
The Schengen Area is a passport union. There are no (regular) passport checks between Schengen Area countries.
Is this one through booking, or two separate bookings?
If one booking, your bags will be sent directly to your final destination and you will stay "airside" and not go through UK immigration. the procedure is:
Land - disembark - possibly change terminals (airside) - security - board
You have enough time.
You have done this as two separate bookings. Which means you have to check in again for your second flight:
Land - disembark - go through immigration - luggage reclaim - customs - exit to arrival area - possibly change terminals - check-in (BA) - security - immigration (leave UK) - board
Time will be tight, and if your first flight is late you are not covered.
In both cases you go through immigration when you land in Italy.
You need to find out which terminals your two flights are using. Some Heathrow terminals require a train between them.