how long does a uv sterilizer take to work?

It should take about 24-48 hours to kill all of the free floating bacteria. Even after that, the water will still be brownish-green(free floating dead algae). Give the UV 24-48 hours, and then do a 50% water change to help pull out the dead stuff. If you have any kind of micron filter, you can hook that up and it'll help remove the dead algae.
 
AquariaCentral.com