You can chose the hidden size as you wish.
The output will have the shape [seq_len, batch_size, hidden_size].
Here is a small example:
seq_len = 2
features = 1
batch_size = 5
hidden_size = 10
num_layers = 1

model = nn.RNN(
    input_size=features,
    hidden_size=hidden_size,
    num_layers=num_layers)

x = torch.randn(seq_len, batch_size, features)
h0 = torch.zeros(num_layers, batch_size, hidden_size)
output, hn = model(x, h0)
print(output.shape)
print(hn.shape)

If you want to transform the output to a target space, you can apply another linear layer as described in this tutorial 73. This would create a model as described in CS231n - Slide 36 60.