The first thing you need to do when trying to figure out when to change your air filter is to look in your owner's manual. You will find a maintenance schedule that lists when all maintenance items (like air filters and oil filters) should be replaced.
You will also notice that there is a "normal" maintenance schedule and a "severe" maintenance schedule. Most people will use the normal maintenance schedule, but if you are driving in conditions that will cause more dirt to get stuck in your filter, then you should go by the severe maintenance schedule.
The first rule of thumb is to go with what the service manual says. If your car or truck is under warranty then you need to be sure to change your air filter at least as often as it says in the manual. If you don't then it could void your warranty.
If you don't have your owner's manual or if your car or truck is not under warranty anymore then you can decide for yourself when it needs to be changed.
When to change air filter in a car: I change my engine air filter every year or so. I drive in many different conditions and on many different types of roads so I need to change my air filter more than some people.
If you just drive on roads most of the time, then you can probably go two years or more without having to replace your filter. However if you drive long distances, or drive in dusty or offroad conditions (e.g. rural areas, construction zones, gravel roads), then you will need to change your air filter more often.
Most cars and trucks are just used to get from one place to another. If you drive a high performance vehicle in which the amount of air going into the engine may be more crucial then you may need to change your air filter more often.
Now that you know when to change air filter in a car, what's left is to remind yourself to check your engine air filter every six months or so.
On more than one occasion, I have found mouse nests inside the air box under the filter. I even seen one air filter that the mice had partially chewed through which meant that the engine was sucking in unfiltered air. Checking your air filter every six months will help you notice if anything like this is happening and catch it before it causes any damage.