Star Trek: The Next Generation: Season 1, Episode 9
The Enterprise encounters Q again, and he tempts Riker by endowing him with the powers of the Q.