Whimsalot will gain 1 hp and attack for every ally on the field, for a maximum total of 7 attack and defence. As such it is best used with at least one ally is on the board. Like with every other Battlecry, Whimsalot's ability occurs when placed and cannot be altered after by the loss of ally cards on the field. It can however be reduced to its base stats via Silence by cards such as the Nacarat Jester.
Similarly, like most cards, being sent back to the deck/hand will cause the Battlecry buff to be removed along with any other status effects.