Take the canonical morphism $X=\mathbb A^1_{\mathbb Z}=\operatorname {Spec} (\mathbb Z[T])\to \operatorname {Spec} \mathbb Z$, which has fiber $\mathbb A^1_{\mathbb F_p}=\operatorname {Spec} (\mathbb F_p[T])$ over $(p)\in \mathbb Z$.
This fiber has exactly $p$ points rational over $\mathbb F_p$ .
Edit
The canonical morphism $Y=\mathbb P^1_{\mathbb Z}=\operatorname {Proj} \mathbb Z[T,U]\to \operatorname {Spec} \mathbb Z$ has as fiber over $(p)\in \operatorname {Spec} \mathbb Z$ the projective line $\mathbb P^1_{\mathbb F_p}=\operatorname {Proj} \mathbb F_p[T,U]$, and that fiber has exactly $p+1$ points rational over $\mathbb F_p$-points.
This answers miguels's supplementary question in his comment.