For KDM

Open the file /etc/kde3/kdm/kdmrc as root. Go to line 347, uncomment the line and set its value to On so that it looks like this:

NumLock=On

save and close.

For KDE

Click the K-menu and pick System Settings. Navigate into your Keyboard settings and under NumLock on KDE Startup, pick Turn On, apply and close.