I recommend keeping it no longer than 20 seconds. The shorter, the better, as long as you're still getting the intended message across. The reason for this is most people will immediately click away when they see the end card and this can mess with your audience retention stat which, if I'm not mistaken, does have an effect on ranking. So if your end card is 50% of the length of your video, you're going to have terrible retention stats, whereas, if it's only 5% of the total video length, it won't matter so much if you lose 90% of the remaining viewers when the end card plays.
On a related note, if you want to improve your retention while still having an end card, include bonus clips after your end card. These can be funny bloopers or just a really cool/funny quick clip and it will encourage your audience to stick with the video until the very end. You don't even have to do this on every video, keep them guessing and hoping for that little bonus.