As stated before it depends on the girl, but also how you bring it up. the girl who likes the bad boy will like a bit of the bragging, but dont say it like you are proud of it. Just say something, when the times comes up, "yeah I was in jail for a while. That stuff they show on tv and movies is not totally exaggerated. Some sh1t goes down in there. Luckily I never shanked or raped! But the politics, fights, and horrible conditions are all true"
If its a girl who doesnt like that type of thing you have to go about it differently, if you ever even want to bring it up (there are some things , In my opinion you should take to the grave). It would have to be during a deeeeep conversation where she is also admitting to some skeletons in her closet....then bring it up nonchalantly "Everyone makes mistakes they are not proud of. For instance Its amazing how many different types of people are in jail for pretty bad stuff and also ridiculous stuff. I was in jail for a while and met this guy who did ( say something awful that someone was in there for) anbd this other guy who was doing XXX amount of time for (say something stupid that seems incredible they are in there...i knew a guy when I was in that got locked up for hitting a pizza box, the box hit the girl on the thigh, and he got charged with domestic violence)." She will of course ask why you were in there, and as long as its not murder, rape, or sh1t involving kids.....you are ok to tell what you were in there for and how it happened. Most girls will be on your side once they hear your side of the story and you prep them with the "This monster i knew did this" and "this poor sap didnt do sh1t but got lucked up. the system can be farked".