For me the perfect length is 3 days, though I live in Germany, so travel is a little easier and I don't need to do longer trips to make the transit feel worth it.
The first day at Europa Park, the middle day relaxing (or not!) at Rulantica, and the third day back at Europa Park. I've only gone on off-peak times, so this is more than enough time to do every ride multiple times, see several shows, and still have time to simply hang out if you feel like it, for example at the wonderful Biergarten in EP. By the end of the third day I'm pretty exhausted and ready to return to reality.