I think there was a theorem, like
 every cubic hypersurface in $\mathbb P^3$ has 27 lines on it.
What is the exact statement and details?
I think there was a theorem, like
What is the exact statement and details? 


The exact statement is that every smooth cubic surface in $\mathbb P^3$ (over an algebraically closed field) has exactly $27$ lines on it. Many books on algebraic geometry include a proof of this famous fact. The proof that I first learned comes from chapter V of Hartshorne, where cubic surfaces arise as the blowup of $\mathbb P^2$ at $6$ points, and where the formula $27=6+15+6$ is explained. 


There is a completely elementary (i.e. no surface theory or Chern classes needed) way to carry out this computation. I give you a brief sketch omitting the details. First use an incidence correspondence to prove that every cubic (smooth or not) contains at least one line. Once you have a line l consider planes H containing l. The intersection of H with the cubic is either (l + a smooth conic) or three lines. Moreover in the second case the three lines are distinct and do not meet in one point, otherwise the cubic would not be smooth there. The planes containing l form a $\mathbb{P}^1$, and a simple computation tells you when the residual conic in the plane is smooth. Namely the vanishing of the determinant of the residual conic is an equation of degree 5. This equation has distinct roots, again because the cubic is smooth. We conclude that for a given line l there are exactly 5 planes through l on which the cubic decomposes as the union of three lines. Said differently, every line meets exactly 10 other lines. From the last statement it is a combinatioral exercise to prove that the total number of lines is 27. I hope the sketch is clear enough; feel free to ask more details if some step is too obscure. 


It's a nice application of dimension theory to show that the set of cubic surfaces containing exactly 27 lines corresponds to an open subset of projective 19space; the remaining surfaces either contain an infinite number of lines or a nonzero finite number less than 27. The proof can be found in several places, including Shafarevich's book and my online algebraic geometry notes. 


I recommend Jack Huizenga's answer to the question to "Why are there exactly 27 straight lines on a smooth cubic surface?" on Quora. It's detailed and wellwritten. 


To see the 27 lines, take 6 generic points on P(2) and consider the linear system of cubics through them. This linear system defines a rational map from P^2 to P^3 which is nothing more than the blowup of P^2 on these 6 points. The image is a cubic surface and the lines are:



See the beautiful book of Fuchs and Tabachnikov, Mathematical Omnibus, for an answer. 


... or, also beautiful Manin's "Cubic Forms" (it has a chapter entitled "27 lines"). 


I vaguely remember that Miles Reid gives a handson proof of this towards the end of his LMS Student Text on "Undergraduate Algebraic Geometry", but I don't know how common this is in libraries or if CUP have reprinted it. 


In addition to the nice answers above, here is a QDOS computation you can do in your head. If you consider a family of form XYZ + tF = 0, where F is a general cubic, then there are infinitely many lines on the three planes XYZ=0, but in the given t direction, the only ones that are limits of lines on F=0 are those passing through pairs of points where F=0 meets the axes of the system of planes XYZ = 0. Since F meets each axis 3 times, there are in each plane 3x3 = 9 lines, for a total of 27 limiting lines, hence the general F had 27 lines. Another: In a family QH+tF = 0 where Q is quadratic, H linear, the limiting lines pass through the 6 points where F meets the conic Q=H=0. Exactly 12 lines on Q and 15 on H do this. (These occur in the book by Beniamino Segre.) Or project the cubic to the plane from a point on itself, after blowing up that point to gain a new exceptional line. The images in P^2 of the lines on the surface, are lines everywhere tangent to the branch curve, which is a quartic. Then the 28 bitangents to a plane quartic finish the computation. There is also a nice computation of the degree of the map from the space of lines to the space of cubics, in Mumford's yellow book, AG I, Complex projective varieties, last chapter. Basically he reduces it to the case of the fermat surface X^3 + Y^3 + Z^3 + W^3 = 0, where one can solve for the lines by hand. 


You can see a photo of a model of the cubic in the case when they are all real in the book by Gerd Fischer: Mathematische Modelle/Mathematical Models. The 27 lines are drawn on the surface. 

