For all international travel...if you leave the international holding area (usually a separate wing/terminal area) you'll have to go through immigration and customs. If you are just changing planes the customs/immigration will happen at the first port you actually try to leave the airport. However, in some cases, if your connection is on a local/budget plane it may be in the domestic terminal and therefore considered entering the country and triggering the customs inspection. For example, Delta to Amsterdam and Veuling (budget airline) to Florence...Veuling departs from the domestic terminal so you'll go through immigration/customs then walk over to the other gates. I can't remember if you also have to go through security again? I do remember that coming back through LAX I did customs, terminal walk and second security.
This is an important distinction because in Europe the restaurants and other creature comforts enjoyed during long layovers are often in the main domestic terminal. As I remember Amsterdam had one cafe near my gate and the restroom was quite a hike but still in the international terminal.
Fortunately, all airports publish their terminal maps so if you do have a long layover or your connection is via a local/budget airline you can plan out your time in the airport accordingly. For American Nationals entering the EU countries the difference between immigration and customs is pretty indistinguishable.