When we were there last week and rode the boats multiple times, the captain announced routinely that the last boat leaves the DHS dock one hour after posted park closing time.
Disney won’t leave resort guests stranded. If you miss the last boat, there will be a bus. The bus will drop off at all 5 resorts that are on the Friendship Boat route - Swan & Dolphin, Yacht & Beach, and BW. I’m not sure about Swan Reserve; I don’t know whether the bus will drop off there, or if Swan Reserve guests need to get off at the Swan and walk across the street to SR, which is what they’d have to do when riding the boat.
During the day the boats run about every 20 minutes. At some point in the afternoon they begin coming roughly every 15 minutes.