The invention discloses a phosphorus-containing and rare earth-containing Y molecular sieve and a preparation method thereof, wherein the unit cell parameter of the molecular sieve is 24.35-24.55 angstrom, the phosphorus content (calculated as P2O5) of the molecular sieve is 0.3-10.0 wt% by using the dry base weight of the molecular sieve as the reference, the rare earth content (calculated as RE2O3) of the molecular sieve is 0.5-19 wt% by using the dry base weight of the molecular sieve as the reference, the Al distribution parameter D of the molecular sieve is more than or equal to 0.4 and is less than or equal to 0.9, the volume of the mesopores of the molecular sieve accounts for 25-65% of the total pore volume, the amount of the strong acid of the molecular sieve accounts for 65-78% of the total acid amount, and a ratio of the acid B to the acid L is 21-98. According to the present invention, the catalyst prepared by using the phosphorus-containing and rare earth-containing Y molecular sieve as the active component can have advantages of excellent heavy oil conversion capacity, high gasoline yield, low coke yield and low olefin content in gasoline in the heavy oil cracking reaction.