The question of how long is too long was answered at an annual meeting a few years ago. It was decided that any distance long is too long. A course must be certified at the distance it is measured. If the RD has particular spots where he wants the start and finish to be, and you measure the course with those restrictions to be 5040 meters, then it must be certified at 5040 meters, not 5000.
There is a HUGE difference between people in a race running more than 5000 meters because the RD did not follow the certification map, and those people running more than 5000 meters because the course measurement was inaccurate.