There should be an option within the program to turn it off. There is one way you can try, but you should see if you can find the option within the program first.
One way is to go to Start > Run and type "msconfig" in the prompt and hit enter. Go to the startup tab and uncheck Yahoo messenger. Click Ok and let the PC restart. Though in some cases if the option is enabled in the Yahoo messenger it will add itself back to the list of startup items.