Our goal is to study the physical properties of the circumstellar environment of young stellar objetcs (YSOs). In particular, the determination of the scattering mechanism can help to constrain the optical depth of the disk and/or envelope in the near infrared. We used the IAGPOL imaging polarimeter along with the CamIV infrared camera at the LNA observatory to obtain near infrared polarimetry measurements at the H band of a sample of optically visible YSOs, namely, eleven T Tauri stars and eight Herbig Ae/Be stars. An independent determination of the disk (or jet) orientation was obtained for twelve objects from the literature. The circumstellar optical depth could be then estimated comparing the integrated polarization position angle (PA) with the direction of the major axis of the disk projected in the plane of the sky. In general, optically thin disks have polarization PA perpendicular to the disk plane. In contrast, optically thick disks produce polarization PA parallel to the disks. Among the T Tauri stars, three are consistent with optically thin disks (AS 353A, RY Tau and UY Aur) and five with optically thick disks (V536 Aql, DG Tau, DO Tau, HL Tau and LkHalpha 358). Among the Herbig Ae/Be stars, two stars show evidence of optically thin disk (Hen 3-1191 and VV Ser) and two of optically thick disks (PDS 453 and MWC 297). Our results seem consistent with the fact that optically thick disks at near infrared bands are associated more likely with younger YSOs. Marginal evidence of polarization reversal is found in RY Tau, RY Ori, WW Vul, and UY Aur. On the first three cases this feature can be associated to the UXOR phenomenon. Correlations with the IRAS colours and the spectral index yielded evidence of an evolutionary segregation with the disks tend to be optically thin when they are older.