The diffusion system with time-fractional order derivative is of great importance mathematically due to the nonlocal property of the fractional order derivative, which can be applied to model the physical phenomena with memory effects. We consider an initial-boundary value problem for the time-fractional diffusion equation with inhomogenous Robin boundary condition. Firstly, we show the unique existence of the weak/strong solution based on the eigenfunction expansions, which ensures the well-posedness of the direct problem. Then, we establish the Hopf lemma for time-fractional diffusion operator, generalizing the counterpart for the classical parabolic equation. Based on this new Hopf lemma, the maximum principles for this time-fractional diffusion are finally proven, which play essential roles for further studying the uniqueness of the inverse problems corresponding to this system.