Link to the website of NLG, the ferry company providing service to the Tremiti Islands.
I see that the in-season schedule isn't yet posted on the company's own website, so I guess you'll need to keep checking. I found the company website via Rome2Rio.com, which says the ferry takes 75 minutes and runs just once a day. That wouldn't work for a day trip, obviously, but perhaps that information is incorrect. Rome2Rio often gets the details wrong, or it may well be showing today's (off-season) schedule.
And, indeed, Google took me to the OK-Ferry website, whose look-up function produces more encouraging results: a shorter travel time and multiple ferries each day for Thursday, June 1. So I think you can pull this off. Just keep checking the NLG website for the official info.
As a general tip, Googling what you want to do (Ferry to Tremiti Islands) will often produce results.
I've visited the Gargano Peninsula (briefly) a couple of times; it's very pretty. I have not been to the islands but would like to do so. Hope you'll report back after your return.