In the NCERT textbook of class 12, in the section on applications of Gauss's law, there are three applications. The first application is to calculate the electric field intensity around an infinitely long wire of uniform charge, and the second application is to calculate the electric field intensity around an infinitely large plane sheet of uniform charge. Why these applications specifically?
It is not that we 'need' to use an infinite wire or plane. For example, I am sure there must be problems in the N.C.E.R.T. textbooks where you use a finite charged wire to calculate the electric field at a given point. The point of using infinite wire or plane is that once you know the perpendicular distance of the point from the wire or the plane of the sheet, you don't care 'where' the point is in space, as the electric field depends only on the perpendicular distance. Further, when you are calculating electric field at distances(perpendicular) very near to the wire or the plate, you can assume effectively the wire or plate to be infinite in dimensions on a comparative basis. As an exercise you can calculate the field at a very small distance from the wire as compared to the length of the wire and see that it indeed gives the same value as an infinite wire. For the case of a charged plate, the calculations would be a bit more lengthy, but similar arguments hold. Obviously we don't have infinite charge distributions in practical applications.
As you would further study 'Gaussian Surfaces' you would see that the sphere, cylinder and pillbox are the easiest symmetries to apply Gauss's Law to in Electrostatics and hence you would come across line, spherical and planar charge distributions often in electrostatics.