It depends on the country and prison, but it might not be free and usually requires working a job. For example, most states in the US allow for charging prisoners: finesandfeesjusticecenter.org/…/americas-dystopia…