Head-to-head and tail-to-tail 180 degrees domain walls in a finite isolated ferroelectric sample are theoretically studied using Landau theory. The full set of equations, suitable for numerical calculations, is developed. The explicit expressions for the polarization profile across the walls are derived for several limiting cases and wall widths are estimated. It is shown analytically that different regimes of screening and different dependences for the width of charged domain walls on the temperature and parameters of the system are possible, depending on spontaneous polarization and concentration of carriers in the material. It is shown that the half-width of charged domain walls in typical perovskites is about the nonlinear Thomas-Fermi screening length and about one order of magnitude larger than the half-width of neutral domain walls. The formation energies of head-to-head walls under different regimes of screening are obtained, neglecting the poling ability of the surface. In the nonlinear regimes of screening, this energy is equal to the energy necessary for the creation of electron-hole pairs in the amount sufficient to screen the spontaneous polarization, which is proportional to the band gap of the ferroelectric. It is shown that either head-to-head or tail-to-tail configurations can be energetically favorable in comparison with the monodomain state of the ferroelectric if the poling ability of the surface is large enough. If this is not the case, the existence of charged domain walls in bulk ferroelectrics is merely a result of the domain-growth kinetics. Formation energies of the other possible states, i.e., the multidomain state with antiparallel domains separated by neutral walls and the state with the zero polarization, were compared with the formation energy of the charged domain wall. It was shown that, at large enough sample thicknesses, a charged domain wall can be energetically favorable in comparison with the states mentioned above. This size effect could explain why charged domain walls were observed experimentally in bulk lead titanate but not in barium titanate. The results obtained for the case of an isolated ferroelectric sample were compared with the results for an electroded sample. It was shown that a charged domain wall in an electroded sample can be either metastable or stable, depending on the work-function difference between electrodes and ferroelectrics and the poling ability of the electrode-ferroelectric interface.