After a postdoc period, how to understand if you should go for a second postdoc or apply for a permanent position?
This can vary greatly by subfield, country, etc., so there's no universal answer to whether a second postdoc is necessary or a good idea.  People typically make the decision based on several factors:


You should ask your mentors (your postdoctoral advisor, Ph.D. advisor, and other faculty you know) for advice.  They can offer insight that takes into account both your accomplishments so far and the job market you will be applying in.
You should compare yourself with other people you know who have gotten jobs recently.  Making these sorts of comparisons is tricky, so you shouldn't take this too seriously, but it will give you a feeling for where you might stand.  If your colleagues regularly get permanent positions after three years with accomplishments like yours, then you should try applying for such jobs too.  If they don't, then you shouldn't expect to be so lucky yourself.
Most people aren't quite certain, and they end up applying for a mixture of postdoctoral and permanent positions.  That's fine, and it's counterproductive to focus 100% on one type of job unless you are sure the other would be unavailable or undesirable.