The dependence of critical current density (Jc) on applied magnetic field (B) and angle (ϴ) between B and the c axis has been investigated to determine the anisotropy of MgB2 thin films at different temperatures. The results have been compared with upper critical field (Hc2) anisotropy (γH) determined by measuring Hc2 for fields applied parallel to the ab plane and the c axis. Contrary to the case of Bi2Sr2CaCu2O8 and YBa2Cu3Ox, where Jc(ϴ,H) scales with H/Hc2(ϴ), Jc(ϴ,H), for MgB2 did not follow this scaling. Surprisingly, the temperature dependence of anisotropy determined from Jc(ϴ,H) is similar to the predictions for penetration depth anisotropy of MgB2. These results have been understood as a combined effect of a two-band theory and the collective pinning model, in which Jc strongly depends on the elastic properties of a vortex lattice.