Size will depend on your bike. Try to get an "absolute" measurement from the front of the front tire to the back of the tail-lamp or fender if it is a cruiser and has a fender/taillamp. Otherwise, measure from the front of the front tire to the rear of the rear tire...Most bikes are longer than they look.
I know 8' would be too short for a modern H-D Wide Glide, the gate would close onto the lamp/fender for sure. I just helped my neighbor alter his 6x8 open trailier with a mesh gate/ramp so his Wide Glide would fit on it. We knocked out the front and extended it 1' so the gate wouldn't hit his fender/lamp lens.
Where the "center stringer" under the trailer's floor is may also be a concern. Make sure you can put your front tire carrier somewhere toward the middle of your trailer, otherwise, you will have to go to one side or the other of the center stringer/support and *then* your handlebar width becomes a concern. I'd advise taking your front tire carrier with you to look at the trailer and make sure that it can mount in a good place for the "width" of everything about your bike, particaulrly your bars if it is a cruiser type and they have any width to them. On my neighbor's trailer, we couldn't mount the carrier dead-center due to the stringer (way it was built) and had to move it over to the side. His trailer was open, and his bars were OK. Had it been an enclosed trailer, his right bar would likely have hit the wall.
Just some ideas, you didn't mention what *type* of bike or trailer. If it is a little dirt bike and an open trailer, 5x8 should be fine - though I would still get an overall length on the bike, and measure that against the trailer before I actually bought the trailer just to be certain.