If you do a slideshow in iPhoto and put a piece of music in, you can get mixed results. If your slide show is too short, the music just cuts off. If it's too long, the music will just start over again. The timings are a little fast and loose if you're just playing the slideshow on your Mac, but if you're exporting the slideshow to QuickTime, I figured out how to time it so the end of the slide show matches up with the end of your music.
First, find out how long your music is. In my case, let's say it's 2:05. In seconds that's 125. Take the number of slides in your show, and subtract that from the seconds you have. That's for each dissolve between slides, which is set at 1 second each (I haven't found any way to change that). Then subtract 2 more seconds. This is for extra time for the fade up from black at the beginning of the slide show, and fade down at the end. In our case, that leaves us with 97 seconds.
From there, it's simple division to figure out how long to make each slide appear. In my case, 97 divided by 26 slides is 3.73 seconds (rounded to the nearest hundredths place). Viola! Perfect slideshow timing. 😀
As a more compact algebra equation, it can be expressed as the following, with 'n' being the number of slides, 't' being the time in seconds of the music piece and 's' being the number of seconds each slide should appear. You can always cut a piece of music to the time you want for the slides as well. Just plug in the 2 variables you know, and solve from there!