There is no one general rule. Each airline/alliance has their own rules as to access to F or J lounges.
Even within alliances, different airlines have different rules, so you see how difficult it would be just to give you one answer. Status also comes into play as well as memberships, etc...etc...
If you have specific airline/alliance in mind, post this question on appropriate forum with any and all ticketing info you have and I'm sure it will be answered quickly.