Note that he created a sort of HUD spell on his hand just before his confrontation with Dormammu:
He checks it every time a new iteration of the loop is started:
I took that as a sign that this thing on his hand displays information on how many loops have elapsed.
On the other hand, Dormammu doesn't have this thing, but still remembers previous iterations. It is implied, subtly, that Dormammu experiences some sort of deja vu; I guess same can be said about Strange - this is how he remembers how Dormammu attacked him before.
The director Scott Derrickson referenced this in an interview with Empire (as cited in @Jason Baker's answer):
“We had a line, where Strange said, 'we've been through this a thousand times'. Literally. I fancied the idea that they went through it thousands of times before Dormammu finally realised he wasn't going to get out of it.”
So it seems that Strange is aware of the repetitions not only subconsciously, but also quantitatively.
There is also a thread at Quora, though they don't exactly provide any canonical evidence.