No one likes malware; web surfers, searchers, webmasters, and so on. But malware can hurt a lot when your search result in Google is labeled as not being safe due to malware. No one will click on your result, for good reason.
Often, malware gets onto a site though some type of security breech. Hackers take advantage of those loop holes and then place malware on your site, that may infect your visitors. So Google (and other search engines) try their best to keep people away from your sites, if they believe your site has been infected with malware.
That being said, if you are able to remove the issue from your site and your site is malware free - you can remove that message in the Google search results within 24 hours.
A Google Webmaster Help thread has JohnMu of Google saying, "automatic reviews generally take about a day until everything is cleared up (warnings everywhere); there are situations where they take much less time and there are times when they take a bit more."
For more on this, check out Google's blog post on this matter.
Forum discussion at Google Webmaster Help.