It is a degree adverbial of duration; they are synonymous, and either form is acceptable (the 'for' form is quite formal). ' A: 'He played for an hour'.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.