Have a look at below links where it is explained in details.
Query-level cache:
Hibernate also implements a cache for query resultsets that integrates closely with the second-level cache.
This is an optional feature and requires two additional physical cache regions that hold the cached query results and the timestamps when a table was last updated. This is only useful for queries that are run frequently with the same parameters.
Second-level cache
Hibernate is compatible with several second-level cache providers. Any implementation can be used for second level cache.
Difference:
Query Cache's sole purpose is to cache the queries whereas Second Cache can be used to cache for other caches also.
Query cache is provided by Hibernate internally whereas for Second level cache you have to choose some external second level cache such as Infinispan, EHCache etc.