In panel data application, when using Fama and MacBeth regression is preferable over the fixed or random effect model? thought When discussing panel data, many econometric books, usually, focus just on fixed or random effect model as means of estimating regression for panel data. Despite this tendency, I have seen many papers use Fama and MacBeth regression for this purpose, an approach I previously thought its application is constrained to asset pricing models like CAPM. 
Now my question is: in panel data application, when using Fama and MacBeth regression is preferable over the fixed or random effect model? Is there a statistical test shedding light on this issue? Another question is: in Fama and MacBeth regression can individuals under study be different in different time periods? It would be very kind of you, if you guide me through a link or book dealing whit this subject.
I cannot precisely answer your questions because I do not know which exactly regressions you want to perform as @jmbejara says and which papers are you referring to that use Fama-MacBeth regression. Are they on financial or other literatures? I haven't seen Fama-MacBeth on other literatures (I do not follow any other literature to be exact), so please post the papers. Obviously, if in other literatures one can justify the analogy of the risk-premia concept, Fama-MacBeth can be applied there, too.

I answer your three main questions in reverse. 

3. It would be very kind of you, if you guide me through a link or book dealing whit this subject?

If you are interested in financial panel data, there are plenty of resources to consult. Some are: 


The amazing book of Bali, Engle, and Murray (2016). "Empirical Asset Pricing: The Cross Section of Stock Returns", because it explains the Fama-MacBeth procedure (among others) step-by-step and I find it the most important of all the resources (ToC available here).
For more information on the standard errors, Petersen (2008, published in the RFS) with his article "Estimating Standard Errors in Finance Panel Data Sets: Comparing Approaches" (it also seems available online here) compares different approaches and highlights their intricacies. This paper is crucial for any financial panel data research paper!
Goyal (2012) in "Empirical cross-sectional asset pricing: a survey" also explains the Fama-MacBeth approach with different applications.
Chordia, Goyal and Shanken (2015) in "Cross-Sectional Asset Pricing with Individual Stocks: Betas versus Characteristics" because it has an extensive discussion for the Errors-in-Variables problem of the Fama-MacBeth procedure.
Jagannathan, Skoulakis and Wang (2010) (also a draft) contains more "mathematical/econometric" formalization.


2.  In Fama and MacBeth regression can individuals under study be different in different time periods? 

Yes, and this is one of the reasons that Fama-MacBeth is appealing, since you can run it on unbalanced panel datasets. In a balanced panel, every individual has data for the same/every time period, while in an unbalanced this is not a requirement.

1. In panel data application, when using Fama and MacBeth regression is preferable over the fixed or random effect model? Is there a statistical test shedding light on this issue? 

Usually, in finance, a fixed effect concerns a firm effect (dummy for firms), while Fama-MacBeth is designed to account for a time effect (Petersen (2008)).
Random effects are rarely used in the financial literature (Petersen (2008)). As he says: "When the residuals of a panel regression are correlated, not only OLS standard error estimates are biased but also the coefficient estimates are inefficient (the estimates do not exploit all of the information in the data). Researchers can improve efficiency by estimating a random effects model using a GLS approach."

To sum up:


I find Fama-MacBeth appealing for accounting for time-effects (it's easy to calculate time-varying betas, for example)
it has easy intuition for the financial literature, and 
it can be applied to unbalanced panels.


People use the Hausman test to decide between fixed/random effects models, but I find the intuition and justification of the choice of the proper model more appropriate. I am unaware for a specific test which includes Fama-MacBeth but I am far from an expert in the field.