I am in the same place in riding as you. So far, I have only squeezed in about 10-12 mile rides a couple times a week. So one day, I did a 22 mile ride (with hills). The only thing, is that I did not carry any food. That was my mistake. It took me several hours and I was very tired at the end, especially because there is a very steep, one mile hill to my house. So now I know what bonked feels like.

I learned several things from this experience:

1. Yes, it is best to build a base of miles if you are a new rider. (and if you are overweight as I am.) (But, I still plan to do rides beyond my level from time to time.
2. Carry snacks if the ride is over an hour.
3. There is no shame in walking up a hill if necessary.
4. There is no shame in riding slowly if that is what you have.

The best advise I have ever heard for new riders is to just ride and not worry too much about miles or hills. (within reason of course)

-Sue