There are a bunch of smartphone apps that calculate the variables for time-lapse capture. Some are free, some aren't. And some are unnecessarily complicated.
One of the simplest to use yet most effective is Timelapse Calculator for iPhone by CLamCam Video.
The basic idea of any time-lapse calculator is to work out the combination of interval and number of photos it takes to produce a video of a certain length or to cover an event of a certain duration.
For one example, maybe you want to do time-lapse of clouds passing overhead and you want to find out how long you need to keep the camera rolling undisturbed to create a 30 second video at a frame rate of 30 fps with 5 seconds between shots (answer: 1.2 hours).
Or for another example, perhaps you're doing time-lapse of an event lasting 4 hours and you want to find out how long you should leave between shots to make a 45 second video at a frame rate of 24 fps (answer: 13.3 seconds).
And that's precisely the kinds of things Timelapse Calculator will do for you. You can even save presets for calculations you make frequently, which is a nice touch. But it won't take the photos for you . . .
Bonus extra: Some time-lapse calculators will work out how much space the images will take up on your memory card. You can't do this within this iPhone app, but the developer has a calculator for that on their website (find it at the bottom of the page here).