Hi~ 有时 itself is just an adverbial that indicates frequency meaning "sometimes". It is what comes after and how this plays in the context of the sentence that gives off positive or negartive meaning. For example:
她是个很守时的人, 偶尔有时迟到是因为堵车了。(She is a punctual person. Sometimes she is late because she runs into a traffic jam.) In this sentence, we still think of her as being able to stay punctual; and if she is late, it must be because of something out of her contral.)
小明不怎么用功,他有时不来上课,也不交作业。(Xiao Ming is not a very studious student; sometimes he misses classes or homework.) This sentence expresses negative impression on Xiao Ming.
Chinese is a more context-dependent language. So, in many cases, we need to take the entire sentence into consideration, instead of just a word.
(more)