Stocks closed lower Tuesday, ending a five-day run of record finishes for the Dow Jones Industrial Average and S&P 500, after July retail sales came in weaker than expected.