Ahhh... A subject of some debate...
BUT, the general rules are that tennon thickness should be 1/3 to 1/2 of the stock thickness. There are some things you'll have to consider though - Like how big the porportions of the mortise will be. You don't want to leave your mortises with walls that are so thin that they create a weak link.
Tennon width is usually limited to about 4". You don't really want to go bigger than that, because of expansion/contraction issues - Again, there are exceptions, but these are the general rules.
Tennon length can vary quite a bit. In the 2x4 scenario, If I were makeing a door or a frame, I'd make the tennons 2" long, or more. The longer the better. If I need even more strength, I'll cut a through mortise, and wedge into the ends of the tennon (3 1/2"long tennon), locking everything together.
Hope this helps!