Gmina Walim is a rural gmina (administrative district) in Wałbrzych County, Lower Silesian Voivodeship, in south-western Poland. Its seat is the village of Walim, which lies approximately 15 kilometres (9 mi) south-east of Wałbrzych, and 64 kilometres (40 mi) south-west of the regional capital Wrocław.
The gmina covers an area of 78.75 square kilometres (30.4 sq mi), and as of 2019 its total population is 5,416.
Gmina Walim is bordered by the towns of Jedlina-Zdrój, Pieszyce and Wałbrzych, and the gminas of Głuszyca, Nowa Ruda and Świdnica.
The gmina contains the villages of Dziećmorowice, Glinno, Jugowice, Michałkowa, Niedźwiedzice, Olszyniec, Podlesie, Rzeczka, Walim and Zagórze Śląskie.