How do I prevent my photos from automatically syncing from my iPhone to my Mac?
Firstly, you can't prevent your iPhone from doing things on the user end of tasks. Thats the user's job. Secondly if your concern is privacy, automatic sync to iPhoto is the lesser of your worries. iCloud automatically syncs your photos to the cloud which can be seen from any device using your apple ID. If your computer is a publicly used computer a specific password protected login account would be a better fit for you.  

Regardless, to answer your question is a quick and easy method. Go to your spotlight search and type Image Capture or you can find the application in your 'Applications' folder. 

When the device is plugged in you will see its title populate in the left sidebar. Click on it. This is what your screen will now show:


You may or may not see the bottom bar, if not just expand it to show more options and your screen will now look like this:


Simply change your method to No Applications. Alternatively, this can be done within iPhoto preferences, however, I just wanted to point this option out to you for future references.