I am not aware of any legislation in that the Legislative branch is limited to determining the number of Justices serve on the SCOTUS.Please provide the legislation restricting the Supreme Court from overruling a past decision.
However, Stare decisis (Latin for “to stand by things decided”) is basically the concept of precedent applied to SCOTUS rulings
When an issue has already been ruled on SCOTUS will usually defer to its previous decisions even if the soundness of the decision is in doubt.
For the most part, the SCOTUS will invoke Stare decisis when the ruling dealt with the Constitution, or a statute that has been ruled to require strict scrutiny (the legislature must have passed the law to further a "compelling governmental interest," and must have narrowly tailored the law to achieve that interest).
In such cases the SCOTUS will not hear nor overturn a previous ruling.