The only people who can see when you're online are the contacts you can see online.
If you've blocked someone, that person won't be able to see when you are online.
If you prefer that no one sees you're online, you can set your status as 'Invisible.' (Please note that, currently, invisibility is only available in Safari 3.0+, Internet Explorer 6.0+, Mozilla Firefox 2.0+, and Google Chrome.)
Learn about changing your status.