Your question involves electron configurations, valence electrons, and the periodic table, all in one. There are multiple ways to solve this question, all arriving at the same answer. I'm not sure which makes the most sense to you, but here it goes:
1. The Aufbau Principle (long way)
For this question, you no doubt have already referenced and learned the Aufbau principle for electrons, the order at which electrons fill the various energy levels and sublevels around a nucleus. While known the order is best, don't be afraid to look it up in your textbook. You'll find a variety of ways describing it, but you should see the diagonal rule attached to this answer which guides you through them. You should know about the different sublevels (s,p,d, and f) and the number of electrons each can hold (2, 6, 10, and 14). When looking at the coefficients of each letter, you're actually seeing the different energy levels that the sublevels belong to. For your question, you want the element that has three energy levels and 7 valence electrons, or 7 electrons on the third energy level. If you trace through the image, the first sublevel you hit on the third energy level is the 3s, which can only hold 2 electrons. Since you want 7 valence electrons, you have to account for the other 5. If you keep tracing the image, you then come to the 3p sublevel, which can hold 6, but you only have 5 left. This means that the last part of your configuration should be 3p^5. According to the Aufbau principle, each energy level (and sublevel) should be filled before you fill the next. In other words, everything before 3p should be full. Trace along the diagonal rule and you arrive at:
1s^2 2s^2 2p^6 3s^2 3p^5
Each superscript (exponent) tells you how many electrons are in each sublevel. If you add them all up, you have 17. Thus, this element that has three energy levels and 7 valence electrons must have 17 electrons total. When you look at the periodic table, chlorine, Cl, is atomic number 17.
2. The Aufbau Principle and the Periodic Table (the easier way)
The more electron configurations you work out and study, the more comfortable you will become with them. The odd shape of the periodic table stems from the arrangement of all the electrons around a nucleus for each element. Attached, you'll find another image for the Aufbau principle, except it overlaps the periodic table. To make sense of it, start in the top left at hydrogen, and then trace your finger to the right (helium). Then go to row two, starting at where lithium is found and again trace right until you find neon. If you continue in this pattern, you are following the order of the sublevels. Your question asks for an element with three energy levels and 7 valence electrons. If you trace the periodic table, the first time you find something on the third energy level is 3s (the third row). If you trace that row, you'll move one spot over and fill the 3s sublevel. You would have covered 2 elements for the 2 electrons an s can hold. 5 more valence electrons have to be accounted for. If you continue tracing that row, counting along the way, you'll find yourself in the p-block. If you count to five in the p-block, you'll stop in the position that chlorine can be found on a standard periodic table. It is the 7th element on row three of the periodic table, 5th element in p-block on row three. Your answer is again chlorine, Cl.
3. The periodic table and groups (easiest way)
The group numbers on the periodic table reference electron configurations. Elements in group 17 or group VIIA (same group), they will have 7 valence electrons. The row or period an element is found on references the highest occupied energy level for that element. For an element to have three occupied energy levels and 7 valence electrons, it must be on row three and in group 17 or group VIIA. Again, you find chlorine, Cl.
They each arrive at the same answer. The only difference is which way your brain likes to see the issue.