Nuclear weak rates in stellar environments are obtained by taking into account recent advances in shell-model studies of spin-dependent excitation modes in nuclei including Gamow-Teller (GT) and spin-dipole transitions. They are applied to nuclear weak processes in stars such as cooling and heating of the cores of stars and nucleosynthesis in supernovae. The important roles of accurate weak rates for the study of astrophysical processes are pointed out in the following cases. (1) The electron-capture (e-capture) and β-decay rates in sd-shell are evaluated with the USDB Hamiltonian and used to study the evolution of O-Ne-Mg cores in stars with 8-10 M ⊙ . The important roles of the A =23 and 25 pairs of nuclei for the cooling of the cores by nuclear Urca processes are investigated. (2) They are also used to study heating of the O-Ne-Mg core by double e-captures on 20 Ne in later stages of the evolution. Especially, the e-capture rates for a second-forbidden transition in 20 Ne are evaluated with the multipole expansion method by Walecka as well as the method of Behrens-Bühring. Possible important roles of the transition in heating the O-Ne-Mg cores and implications on the final fate of the cores (core-collapse or thermonuclear explosion) are discussed.(3) The weak rates in pf -shell nuclei are evaluated with a new Hamiltonian, GXPF1J, and applied to nucleosynthesis of iron-group elements in Type Ia supernova explosions. The over-production problem of neutron-rich iron isotopes compared with the solar abundances, which remained for the rates according to Fuller, Fowler and Newman, is much improved, and the over-production is now reduced to be within a factor of two. (4) The weak rates for nuclei with two-major shells are evaluated. For sd-pf shell in the island of inversion, the weak rates for the A=31 pair of nuclei, which are important for nuclear Urca processes in neutron-star crusts, are evaluated with the effective interaction obtained by the extended Kuo-Krenciglowa (EKK) method. Neutron-rich nuclei with and near neutron number (N ) of 50 are important for core-collapse processes in supernova explosions. The transition strengths and e-capture rates in 78 Ni are evaluated with a new shell-model Hamiltonian for the pf -sdg shell, and compared with those obtained by the randomphase-approximation (RPA) and an effective rate formula. (5) β-decay rates and half-lives of N =126 isotones, the waiting point nuclei for r-process nucleosynthesis, are evaluated by shell-model calculations with both the GT and first-forbidden transitions. The important roles of the forbidden transitions are pointed out for the isotones with larger proton number (Z). The half-lives are found to be shorter than those obtained by standard models such as the finite-range droplet model (FRDM) by Möller. (6) Neutrino-nucleus reaction cross sections on 13 C, 16 O and 40 Ar are obtained with new shell-model Hamiltonians. Implications on nucleosynthesis, neutrino detection, neutrino oscillations and neutrino mass hierarchy are discussed.