Upvote:5
Promoting some comments to answers - it all depends...
If you are on a single ticket (so a through booking from the US to Edinburgh), then no. Your bag will be checked all the way through from the US to Edinburgh. When you arrive at Heathrow, you will need to clear UK immigration in Heathrow. You'll do that at the departing terminal, having followed the purple Flight Connections signs for the airside transit (if not the same terminal). On arrival into Edinburgh, you will collect your bags, and then clear customs with them in Edinburgh. (Edinburgh should be fine for this, but if you connected onto a flight to a smaller UK airport you might have to use the special phone in the baggage hall to contact Customs if you have something to declare)
If you are on two tickets, but within the same alliance (eg American Airlines onto British Airways, or Delta onto Virgin Atlantic Little Red), then you should be able to ask at checkin for them to check your bags all the way through. Generally speaking, if the two legs are on the same alliance, they'll check it through onto the second leg. You'd then follow the above.
If it's two tickets without an alliance (eg flying in on American Airlines, carrying on with Virgin Atlantic Little Red), then you will be required to clear immigration, collect your bag, and clear customs. After that, you then take the free train or bus to change terminals (as required), then check in for flight #2 and check bags there.
Easy summary - 1 through ticket or 2 tickets but same alliance where you can show both tickets and ask them to check through:
2 tickets from airlines who won't check through: