There are two possibilities :
You have other waypoints on the maps
If the waypoint you just reached is not the last one on the map, your boat will then change course and sail to the next waypoint in a straight line.
You have no other waypoint left on the map
If the waypoint you are sailing towards is the last one on the map, your boat will keep sailing in a straight line after reaching it, keeping the same heading.