There is a difference.
'[The] history of the world' is one very, very long story. It recounts what has happened in the world from the beginning of recorded time right up to the present day. In terms of grammar, it's a countable noun.
For example, "This is the first time that such an event has happened in the history of the world".
'World history' is a field of study. 'World' is used adjectivally here, to distinguish it from 'local history' or 'British history' or 'European history'. You might find books on world history in a library, next to 'world geography'. In terms of grammar, it's an uncountable noun.