The entries of the matrix tell you what the inner product does to basis elements, e.g. the top left-hand element of the matrix tells you what you get when you do <e_1 , e_1>. If you know what it does to the basis elements you can extend it to any vector.