I'm playing a game on chess.com and I want to move my Queen to h7. The website won't let me move it there. I tried moving it to other places but the only way I will let me move it is vertically. Is there a rule or something I'm missing, or is this a bug in the game?
As pointed out, your Queen is in what is called an "absolute" pin. It absolutely cannot move off of the file, in this case the "e" file because the black Rook is controlling the squares on that file up to the point of your King. It appears that your only choices in the position you are in, if it is white to move, would be 1. Qxe8+ expecting the response 1....Bxe8 or 1...fxe4. Also you could move 1.Be3 (to block the Rook's pin) expecting the response to be either 1....Rxe4 allowing you to recapture 2. Bxe4 or less likely 1...dxe3 which would leave the King un pinned but the Queen still under attack.
A second form of pin is "relative" pin where the piece behind the directly attacked piece is something other than a King. In other words, something you value but not something that would create an illegal move if it were moved. Imagine in the setting above that the White Queen were a Bishop and the White king were a Queen. You would not want to move the Bishop to expose the Queen which is much more valued. The Bishop is therefore in a relative pin (to the queen).
Hope this helps.