We landed in Madrid last November, after a transfer in London. We arrived via British Airways at terminal 4 at Barrajas Airport, which was kind of a bizzarre experience. It was late afternoon on a Saturday, but it was also the Fiesta de Almudena, a Madrid holiday. There was basically no one in the terminal except us passengers, and we had a looooooooooong lonely walk, routed thru the immense gift shop (which had 2 bored employees), until we arrived at passport control. Whether the ghost-town atmosphere was due to the holiday, or it being mid-November, or what, we don't know. Our passports were checked and we were done in about 15 seconds, but the long walk thru the terminal took some time. Two hours should be adequate time for you, and if you're flying direct from the USA you may not land at Terminal 4, but if you do, you may get a bit of a Twilight Zone experience and the walk will take much longer than the passport control/customs.