In what country or state? They're all different.
As you forgot to give this vital information, I shall answer for England because it's what I know. We don't have jails, only prisons. And prisons have payphones, which prisoners can buy phone time on using the weekly canteen order form. They also vary in how long calls can be. Some prisons limit the length of calls, while others don't - fortunately when I was "inside", it was one that didn't, so I was able to make a long call home every Sunday morning using the money they sent me.
Who you can call is restricted so prisoners don't annoy victims of their crimes. That varies between prisons too but most normally, you have to ask permission first, the prison will call that number and ask if they are willing to accept calls from you, if whoever answers says yes, then that goes on your phone list and you can call them.