Hi Sonia,
I learned in school that "sure" is an adjective and "surely" is an adverb; however, the use of "sure" as an adverb is very common, especially in spoken English. To answer your question, I would use "surely" instead of "sure" if I was writing a formal paper, but probably not otherwise.
I hope that's helpful.