Why ek ghante instead of ek ghanta?
'एक घंटा' is in the oblique case because of the postposition से. The oblique case form of घंटा is घंटे.
What is " Oblique case"
In Hindi, certain words change form when they are objects of a postposition. This is called the oblique case. I've written some more about it here. You can also go through the Duolingo tips section on the oblique case here