Is there a way to automatically put my Android phone into silent mode while recharging? Every night before sleep I usually put my Galaxy S4 into my bed's headboard to recharge, but every night I also get up because of the beep that the phone does when someone send something to my wazzup messenger. 

It's not nice put it into silent mode before sleep and return from it every day, is there any way to do such ting automatically?
You can use Tasker for this (Play Store link). Tasker can create macros that are run on certain triggers, such as connecting the phone to a charger.

An example of the necessary programming can be found here. Check the link for additional info, but here's the necessary part:

Create Profile "Sleep Mode"

Add Context Power
    Source: AC    //You can also set this to all when you
                  //charge your phone using USB.

Add Context Time
    From: 22:00
    To: 07:00
    Repeat: Off

Add Start Task
1.  Silent Mode
    Mode: On
2.  Variable Set
    Name: %SLEEPMODE
    To: 1

Add Exit Task
1.  Silent Mode
    Mode: Off
2.  Variable Clear
    Name: %SLEEPMODE