When to apply for permanent positions while having a lengthy postdoc
Some thoughts:


  
  How do you know when you are "ripe" for the tenure-track market?
  


The easiest thing to do is to try. If you get interviews, then you are ripe. (But the reverse is not true! The way the market is, in many fields you may be ripe but still not get interviews.)

The second easiest thing is to ask your postdoc mentor. 

("Wait, but I am working for them! Wouldn't they want to keep me there?" Having a postdoc placed into a well-regarded tenure-track position is good for your mentor's reputation. It is in his/her interest to maximize your chances of getting a permanent position.)


  
  Will I be shooting myself in the foot applying this year for a position that may have a position in my last year of postdoc?
  


Yes and no. 

If you are obviously underqualified now, your application file will be passed over and forgotten by the time you try again in two or three years. 

If you are somewhat qualified, but not the tops, they may remember your earlier application. Then in addition to judging you on how you compare to other applicants the committee may also try to compare your new file with their impression of your file from before. In other words, you need to show growth in the intervening years. 

If you are good enough to get a position now, why not take it? 


  
  If I take a permanent position early, will this make it much more difficult to obtain a better position later?
  


Only your personal investment and inertia at your new permanent position. 

I would advise against the thought of "shopping" for the best position at this early stage in your career. Unless you are one of the superstars, your goal should be just to get a job first. Worry about better opportunities when they actually happens. Or as the saying goes: A bird in hand is worth two in the bush. 


  
  How can you tell what level one should look to shoot for when applying early and not wanting to take too low of a position on your (personal) ranking?
  


Realistically, the calculation goes something like this:


Final year at postdoc: apply for everything, take whatever you get.
Year -2 at postdoc: If I get this job, I stay employed for three more years! I'll happily take a pay-cut for that. 
Year -3 at postdoc: I have two more years to polish my files. Let's just feel the water and only apply to places I would really want to work at. 


If you are really unsure: more than two years from the end of your postdoc you can afford to be a bit more picky (and err on the side of thinking that you are a superstar). You really don't want to be offered a position that you have to reject because your postdoc is "better". 

One last comment: if you are good enough to attract a tenure-track offer during the earlier part of your postdoc from a large enough institution, there is a non-zero chance that you can ask for a later start date in order to "finish things up at your current position".