Two-weight linear codes are linear codes in which any nonzero codeword can have only two possible distinct weights. Those in the Hamming metric have proven to be very interesting for their connections with authentication codes, association schemes, strongly regular graphs, and secret sharing schemes. In this paper, we characterize two-weight codes in the rank metric, answering a recent question posed by Pratihar and Randrianarisoa.