Can a rook win against a knight in the endgame? Suppose we have a rook and the opponent has a knight next to his king.

Is it possible to win this game theoretically?  

E.g., in the following position (white to move), is it possible for white to win?

[FEN "8/8/8/3n4/3k4/8/K7/R7 w - - 0 1"]
In the specific position that you mention, the answer is a resounding no.  The king and the knight will defend each other, and white will not be able to force mate.

However, the knight is a clumsy piece.  If the knight is not positioned perfectly, then the rook will frequently be able to drive the knight to a bad square and deprive it of moves.  Eventually, the knight may be captured, or the king might be checkmated.

As an example of a position where the rook can win, take the following: 

[FEN "8/1n6/8/8/2R2K2/8/5k2/8 w - - 0 1"]
[SetUp "1"]
[PlyCount "17"]

1. Rc2+ Ke1 2. Ke3 Kd1 (2... Kf1 3. Rf2+ Kg1 4. Rd2 Nc5 5. Kf3 Ne6 6. Kg3 Kf1
7. Rd5 Nc7 8. Re5 Na6 9. Kf3 Kg1 10. Rg5+ Kf1 11. Ra5) 3. Rb2 Nc5 4. Rb6 $22
Na4 5. Rb4 Nc3 (5... Nc5 6. Rd4+ Kc2 7. Rc4+) 6. Kd3 Na2 7. Rb1+ Nc1+ 8. Kc3
Ke2 9. Rxc1 *


Here, white can win starting with 1.Rc2+.  The plan is to drive the king to the first rank and then attack the knight while improving the position of the rook.  



In your question, you mention specific cases where the king and the knight are close together.  In these cases, it is very important to know two key positions:

First, in this position, black can hold the draw:

No matter what white tries, the white king cannot approach the black king due to the knight.  Black will be able to squeeze out with ...Kb2.  Black's plan is to mark time by playing ...Na3 and ...Nb1.  White cannot make useful progress.

This position, almost the same, has one major difference - black can no longer mark time with the knight:

If white plays a waiting move, for example 1.Re2, then black must lose immediately.  Any move will lose the knight or allow mate in one.



If you're interested in a specific position, you can check out the Nalimov Tablebases online.  They have completely solved every position with 6 or fewer pieces on the board.