OK, so the U.S.S. Enterprise (NCC-1701) arrives just as the Titanic hits the iceberg. Captain Kirk says screw the timeline and the Prime Directive and decides to beam them all up. Now, from what I recall watching Star Trek, they only seemed to be able to beam up a maximum of five people at a time, so that means 300 trips to do fifteen hundred people. Figure a minute to beam up five people, and two minutes for them to freak out at Spock's ears and some redshirts to frog march them out of the transporter room. So, that's five people in three minutes, so a hundred people an hour, so, fifteen hours to beam up fifteen hundred people.
On the other hand, the Enterprise carries four shuttlecraft (citation needed) and you could probably cram ten people into the back of one of those things. Assuming you could launch and land all four at once, you could rescue forty people at one go. Say, you allow five minutes to launch and get down to the Titanic, five minutes to load up ten people, five minutes to get back to the Enterprise, and five minutes to offload the people and launch again, then in theory, you could rescue forty people every twenty minutes using the shuttles, or 120 people every hour. At a rate of 120 an hour, it would take 12.5 hours to rescue 1,500 people using the shuttlecraft.
However, if you used the transporter and the shuttlecraft together, then you could rescue 220 people an hour. This would take approximately 6.82 hours.