Prison is different from jail. Prisons are ran by the state or feds. Jails are ran by counties. If you are sentenced to 365 days or more you end up going to prison. I've never been to prison. I've been in an Oregon jail for about 60 days and a California one for about 130 days.
Regarding sentencing, the time spent is ultimately determined by the jail (Sheriff). At the Oregon jail, my sentence was 90 days, but because I was on a work crew and I didn't cause any grief I was released early. I think at most California jails, unless you are an ass, you do 50% of the days.
Prisons and jail are often called "correctional facilities." That's complete BS and only labelled that to ease the collective conscience of the authority industry employees and the public that ultimately builds and supports them.
Jail sucks but mostly from a perspective of being boring. At the CA facility I was at, I was never in a cell. It was a large room with 48 beds. It was a large capacity place (maybe 5000) and I was at the lowest level of security. Honestly, I'd feel more safe with the inmates there than the guards. Regarding the guards, there were two classes. Older guys that liked being a guard more than being a deputy on the streets (less likely to get shot at and more overtime) and young gung-ho guys and gals generally just out of the military. A big percentage of this group, 50% or more, are stupid and some are mean. It's as if if you are a new veteran with no skills and serious personal issues, you can be a deputy. These folks need help and should not be working with people (that's what a guard does).
On a side-note, the worst deputy at the CA facility was a woman, early 30's. Some of the guys said she was a part-time bartender at a local Outback. When people use the term "Nazi" as a derogatory comment, that fits Deputy Carter. Much to my amusement I tried to find her on the internet about a year later and saw that she had been arrested, not yet convicted or sentenced, for having sex with inmates.
Beds are a thin mattress on a steel slab. I could only sleep on my back because it hurt my hip too much to be on my side. Folding a towel into a long strip and maybe four-inches wide and wrapping that around your head to cover your eyes and ears helps with the light and noise. You are outside for maybe three one-hour periods a week. In that yard, there was a pull-up bar and one ball (I think a raquetball) to share. You did get some sunshine. The guards would not allow you to do any exercise in the main "dorm." I think they were afraid you'd get fit and overpower them. I would do some crunches while lying in bed and try to climb the stairs to the upper sleeping porch. This would sometimes draw a command over the intercom to stop. My family made sure I had a lot of books. I slept about 10 hours a day - normal is six or seven. There was one TV shared for 48 beds. No internet. The only females are about 30% of the guards and any health care worker you may see. On a court day or if you seeing a doctor you would also see female inmates - but can't talk to them. Your brain does deteriorate. I did many crossword puzzles and suduko just to keep my neurons firing.
I believe a jail or prison's purpose should be to protect society from bad guys. There are hundreds of studies to show it is not a deterant. Unfortunately the primary purpose is now economic. The system creates jobs and the industry unions are very strong (I'm pro-union). Politicians like the new construction spending. The reality is that these jobs take away traditional education and infrastructure construction jobs. As a society, we'd be better off by cutting the US prison/jail population by 2/3. Retrain the authority industry workers to be in a class room. Actually try to help the people that are dangerous to society. I believe the single largest reason our schools have gone downhill is that we moved funding for them to the prison/jail system.