The ferry from Barcelona takes between 8-12 hours, the ferries from Denia or Palma 2-4 hours. The quicker options on these routes are using the high-speed ferry (which is obviously more expensive).
Below you've got direct access to Balearia's booking system, where you'll be able to check prices and schedules. And if you wish, make your confirmed booking via credit card payment.