Hopefully is an adverb which means what it ought to--"full of hope" or "characterized by hope." It normally modifies verbs.
Nonstandard English sometimes substitutes the word hopefully for I hope (or some other subject with the verb hope).
Correct: They listened hopefully for the sound of the rescue party.
(They listened with hope)
Incorrect: Hopefully, they will come in time.
Correct: I hope they will come in time.In my own opinion, this one may be a lost cause. It's true; it's just plain wrong to use it the way it's always used. But it's has unfortunately become standard, and the standard usage has been affected. If I said, "They listened hopefully for the sound of the rescue party" now, almost anyone who hears me will hear, "I hope they listened for the sound of the rescue party" rather than the actual meaning.