To 'learn something by heart' requires practice. Jesus invites us to practice his words as we build the 'house' of our life on him as a solid foundation, until we learn his way of life by heart.