A bench headed by justice K S Radhakrishnan fixed the time limit and asked the governments to take steps to provide the basic facilities in schools across the country.
The bench said that all its previous directions pertaining to providing infrastructure should be implemented within the time frame fixed by it.
On October 18 last year, the apex court had directed all states and union territories to build toilets, particularly for girls, in all government schools.
The court passed the order on a PIL seeking its direction to Centre and state governments to provide basic facilities of drinking water and toilets in schools.
The apex court had earlier stated that it was imperative that all schools provide toilet facilities, as empirical researches indicated that wherever toilet facilities are not provided in schools, parents do not send their children (particularly girls) to schools.
The court had also observed that not providing the infrastructure was a violation of the right to free and compulsory education of children guaranteed under Article 21-A of the Constitution.