Ernst Haeckel, a zoologist, coined ecology in 1866. While the field is arguably older, Haeckel used the term to describe the relationship between organisms and their environment.
The term began to appear more frequently in the 1890s.
You can read more about the history of ecology here.