for how long/how long

Hello!
Which sentence is correct: ‘How long have you been here?’ or ‘For how long have you been here?’

Thank you for your time!

Both are possible, though ‘for’ is not usually necessary.