There are so many elements to comedy! So many ways to get a laugh, be it through dialogue, props, non-verbal acts, camerawork, slapstick... you name it.
As for that, I recommend you watch a youtube video entitled: "Edgar Wright - How to Do Visual Comedy"
As for timing, I recommend you just watch lots of comedies and cartoons and eventually it will sort of seep in. I know that sounds lame, but you really need to consume a lot of the type of media you want to create so that it becomes a part of you.
Good luck!