1. Emma has waited for him for an hour.

2. Emma has been waiting for him for an hour.

---------------------
Are both grammatical? What is the difference between them in meaning?

They are both grammatical. Basically they mean the same.