I am a beginner in chess. If I have only a king left, how many moves does my opponent have to mate me?
Do you mean "what is the minimum necessary number of moves?", or "what is the maximum allowable?"
Tony has already answered the second question - it could legally be thousands of moves depending on the position. As long as the same position is not reached more than twice and there is no 50 move stretch without a pawn move or capture, the game can go on until there are no pieces left. Theoretically, if you have lost all your pieces and he has lost none of his, he could jockey pieces around (making sure not to allow the same position three times) while every 50 moves moving a pawn or forcing you to capture a piece. The game could go on for over 3000 moves before it must end ([48 pawn moves + 14 captures] * 50 moves = 3100 moves). However, this scenario is extremely improbable, as a quicker mate would certainly be preferred.
As to the first question, if you only have a king, and your opponent has sufficient material to force mate, the minimum necessary number of moves in all positions would be 33 - in the case of King, Bishop, and Knight against King. In other cases, mate could be forced sooner. See Wikipedia again for a table: a queen takes at most 10 moves to mate with best play, a rook takes at most 16, two bishops 19, and bishop and knight (as mentioned) 33. (These are the only entries in the table with the opposing king as the sole defender.) Any other pieces or pawns added would reduce the necessary number of moves.
Depends on where the game is played. USCF forces games to end at 175 moves, so if your opponent leaves you with a lone king on move 174, he has 1 move to checkmate you before it's a draw.
Also other federations and tournaments allow rules where after a certain period of time (not moves) the game goes to adjudication.
Rules of chess are not 100% universal; there are small variations from place to place.
A player with a lone king or king and all pawns blocked can call a draw when if their king is moved 15 times without being checked. Other wise the count restarts. Basically the opposing player has to have atleast a queen, rook, or a pawn that can be promoted and positioned to check before the lone king makes 15 moves or forces draw through repetition.